I use Elastic search and I canβt search for phrases by attributes on which the user analyzer is used.
The custom analyzer is referred to as:
"settings" : { "analysis.analyzer.string_lowercase.type" : "custom", "analysis.analyzer.string_lowercase.tokenizer" : "keyword", "analysis.analyzer.string_lowercase.filter" : "lowercase" }
The value of the attribute is similar to: "in a puddle, out of a puddle", or it can be any String.
I tried using the following:
1) **(Not worked)** QueryBuilders.queryString("*into the puddle*").autoGeneratePhraseQueries(true).defaultOperator(Operator.AND); 2) **(Not worked)** QueryBuilders.matchPhraseQuery(attribute, "into the puddle"); 3) **(Not worked)** QueryBuilders.queryString("*into the puddle*").autoGeneratePhraseQueries(true).defaultOperator(Operator.AND).analyzeWildcard(true);
But, fortunately, try 1, works great with nested objects.
FilterBuilders.nestedFilter(attribute, queryString("*into the puddle*").field(attribute) .defaultOperator(Operator.AND).analyzeWildcard(true));
source share