We're updating the issue view to help you get more done. 

Phrase/match queries on normalized fields built using the DSL fail on Elasticsearch

Description

This seems to be caused by the fact we always include an "analyzer" parameter when building Elasticsearch phrase/match queries, and Elasticsearch won't understand when we pass a normalizer name in this parameter.

For instance:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 private static JsonObject convertRemoteMatchQuery(RemoteMatchQuery query) { JsonObject matchQuery = JsonBuilder.object() .add( "match", JsonBuilder.object().add( query.getField(), JsonBuilder.object() .addProperty( "query", query.getSearchTerms() ) .addProperty( "analyzer", query.getAnalyzerReference().getAnalyzerName( query.getField() ) ) .append( fuzzinessAppender( query.getMaxEditDistance() ) ) .append( boostAppender( query ) ) ) ).build(); return wrapQueryForNestedIfRequired( query.getField(), matchQuery ); }

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Affects versions

5.8.0.Beta3

Priority

Major