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:

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 ); }

Activity

Show:
Steve Ebersole
updated the WorkflowSeptember 14, 2023 at 5:00 PM
Expanded Workflow with pull request
Expanded Workflow
Yoann Rodière
changed the StatusJuly 12, 2017 at 12:27 PM
Resolved
Closed
Yoann Rodière
changed the StatusJune 15, 2017 at 5:28 PM
Pull Request Sent
Resolved
Yoann Rodière
updated the ResolutionJune 15, 2017 at 5:28 PM
None
Fixed
Sanne Grinovero
changed the StatusJune 15, 2017 at 3:41 PM
Open
Pull Request Sent
Sanne Grinovero
updated the Pull RequestJune 15, 2017 at 3:41 PM
None
https://github.com/hibernate/hibernate-search/pull/1450
Yoann Rodière
created the IssueJune 16, 2017 at 8:46 AM
Fixed

Assignee

Yoann Rodière

Reporter

Fix versions

Priority

Created June 16, 2017 at 8:46 AM
Updated July 12, 2017 at 12:27 PM
Resolved July 4, 2017 at 3:51 PM