We are using spring-data-elasticsearch in our Project
we have the autocomplete function for the search textbox. When we type into the search text field, we will fetch suggestions by performing a wild card search with the characters entered in the search box.
public List<String> fetchSuggestions(String query) {
QueryBuilder queryBuilder = QueryBuilders
.wildcardQuery("name", query+"*");
Wouldn't it be better to use ngram/edge-ngram instead of wildcard search? Does ngram/edge-ngram have better performance than wildcard query?