Uploaded image for project: 'Hibernate Search'
  1. HSEARCH-2785

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.8.0.Beta3
    • Fix Version/s: 5.8.0.Beta4
    • Component/s: elasticsearch
    • Labels:
      None

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

        Attachments

          Activity

            People

            • Assignee:
              yrodiere Yoann Rodière
              Reporter:
              yrodiere Yoann Rodière
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: