I have an existing elastic search with lot of data inside it.
I use spring boot
this is my code
logger.info("Find games by criteria : {}", criteria);
List<GameDto> gameDtoList = new ArrayList<>();
ResponseList<GameDto> responseList = new ResponseList<>(gameDtoList, false, page);
// We preprare the query builder to look into all of these attributes
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);
How can I search case insensitive the criteria ?
Thanks