[hibernate-issues] [JIRA] (HSEARCH-3978) Exception when using elasticsearch and multiple analyzers for indexed field in projection query.

Yoann Rodière (JIRA) jira at hibernate.atlassian.net
Fri Jul 31 07:02:44 EDT 2020


Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A58fa1ced-171a-4c00-97e8-5d70d442cc4b ) *commented* on HSEARCH-3978 ( https://hibernate.atlassian.net/browse/HSEARCH-3978?atlOrigin=eyJpIjoiZmZkOTU3OTQwZmM1NGQzOGJiNWMwNjhlMzRkMWQxZDciLCJwIjoiaiJ9 )

Re: Exception when using elasticsearch and multiple analyzers for indexed field in projection query. ( https://hibernate.atlassian.net/browse/HSEARCH-3978?atlOrigin=eyJpIjoiZmZkOTU3OTQwZmM1NGQzOGJiNWMwNjhlMzRkMWQxZDciLCJwIjoiaiJ9 )

Hello,

What I can tell you is this shouldn't work, even with Lucene:

   @Field(store = Store.YES, analyzer = @Analyzer(definition = "phonetic" ))
   @Field(store = Store.YES, analyzer = @Analyzer(definition = "ngram" ))
   private String value;

You need to give a different name to each field:

   @Field(store = Store.YES, analyzer = @Analyzer(definition = "phonetic" ))
   @Field(name = "value_ngram" , store = Store.YES, analyzer = @Analyzer(definition = "ngram" ))
   private String value;

Now the fact that duplicate fields work (or at least seems to work) with Lucene is a problem... But adding an exception would break backward compatibility, so I'm inclined to leave it as is. Duplicate fields *are* forbidden in Hibernate Search 6 already.

( https://hibernate.atlassian.net/browse/HSEARCH-3978#add-comment?atlOrigin=eyJpIjoiZmZkOTU3OTQwZmM1NGQzOGJiNWMwNjhlMzRkMWQxZDciLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HSEARCH-3978#add-comment?atlOrigin=eyJpIjoiZmZkOTU3OTQwZmM1NGQzOGJiNWMwNjhlMzRkMWQxZDciLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100140- sha1:33445dc )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200731/0d61506a/attachment-0001.html 


More information about the hibernate-issues mailing list