I use spring 2.2.4.RELEASE
and spring-data-elasticsearch 3.2.4.RELEASE
My elastic version is 7.10
. I already have lot of index and data in it.
I just notice after once year that the search is not searching case insensitive.
MultiMatchQueryBuilder qb = QueryBuilders.multiMatchQuery(criteria)
.field("displayName")
.field("authorName")
.field("description")
.field("shortDescription")
.field("tag")
.field("translatedMetadataList")
.field("name")
.field("packageName")
.type(MultiMatchQueryBuilder.Type.PHRASE_PREFIX);
// we initialise the native search
NativeSearchQueryBuilder nativeSearch = new NativeSearchQueryBuilder()
.withQuery(qb)
.withPageable(PageRequest.of(page, size));
// if the category is set, we return only this category
if(categoryName.isPresent()) {
nativeSearch .withQuery(QueryBuilders.matchQuery(CATEGORY_NAME, categoryName.get()));
}
// convert native to search
SearchQuery searchQuery = nativeSearch.build();
Page<Game> gameList = gameRepo.search(searchQuery);
my index looks like this
"mappings" : {
"properties" : {
"category" : {
"type" : "nested",
"include_in_parent" : true,
"properties" : {
"description" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"id" : {
"type" : "long"
},
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},...```
how could I do to search case insensitive ?
Thank you.