Phrase/match queries on normalized fields built using the DSL fail on Elasticsearch
Description
Activity
Show:
Steve Ebersole
updated the WorkflowSeptember 14, 2023 at 5:00 PMExpanded Workflow with pull request
Expanded Workflow
Yoann Rodière
changed the StatusJuly 12, 2017 at 12:27 PMResolved
Closed
Yoann Rodière
changed the StatusJune 15, 2017 at 5:28 PMPull Request Sent
Resolved
Yoann Rodière
updated the ResolutionJune 15, 2017 at 5:28 PMNone
Fixed
Sanne Grinovero
changed the StatusJune 15, 2017 at 3:41 PMOpen
Pull Request Sent
Sanne Grinovero
updated the Pull RequestJune 15, 2017 at 3:41 PMNone
https://github.com/hibernate/hibernate-search/pull/1450
Yoann Rodière
created the IssueJune 16, 2017 at 8:46 AMFixed
Assignee
Reporter
Yoann Rodière
Yoann RodièreComponents
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
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 ); }