Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HSEARCH-4679 (
https://hibernate.atlassian.net/browse/HSEARCH-4679?atlOrigin=eyJpIjoiOWR...
)
Re: Automatically simplify and/or predicates with a single clause (
https://hibernate.atlassian.net/browse/HSEARCH-4679?atlOrigin=eyJpIjoiOWR...
)
I believe the best place to do the simplifying would be inside the boolean builders,
e.g.:
*
org.hibernate.search.backend.elasticsearch.search.predicate.impl.ElasticsearchBooleanPredicate.Builder#build
*
org.hibernate.search.backend.lucene.search.predicate.impl.LuceneBooleanPredicate.Builder#build
We could e.g. introduce something like:
if ( (
<only one must clause and no other clause>
|| <only one should clause and no other clause>
)
&& <no other option set>) {
<just return the inner predicate>
}
One thing that worries me, though, is if we introduce new options in the boolean predicate
and forget to test for them in <no other option set> in the condition above. Then
we’d end up ignoring these options in some cases. I wonder if there’s some way to prevent
that from ever happening, just by implementing the build in some smart way…
(
https://hibernate.atlassian.net/browse/HSEARCH-4679#add-comment?atlOrigin...
) Add Comment (
https://hibernate.atlassian.net/browse/HSEARCH-4679#add-comment?atlOrigin...
)
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....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100209- sha1:392b984 )