[hibernate-issues] [JIRA] (HSEARCH-3845) Ineffective search for the "simpleQueryString" predicate.
Waldemar Kłaczyński (JIRA)
jira at hibernate.atlassian.net
Thu Feb 27 19:35:00 EST 2020
Waldemar Kłaczyński ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A77e50cac-bda3-4af4-9bb3-6461f4d10eea ) *commented* on HSEARCH-3845 ( https://hibernate.atlassian.net/browse/HSEARCH-3845?atlOrigin=eyJpIjoiOWQyZjllZWIxZTFmNGUyZmEzZmE2YmRjODdjZjRmOWQiLCJwIjoiaiJ9 )
Re: Ineffective search for the "simpleQueryString" predicate. ( https://hibernate.atlassian.net/browse/HSEARCH-3845?atlOrigin=eyJpIjoiOWQyZjllZWIxZTFmNGUyZmEzZmE2YmRjODdjZjRmOWQiLCJwIjoiaiJ9 )
Alternate query works fine. The problem is that it doesn't complete all the queries as per the documentation.
Does not return results for:
select = scope.predicate().simpleQueryString()
.field( "shoppingName" )
.matching(“rob*“)
.defaultOperator(BooleanOperator.AND);
SearchQuery<Assortment> query = session
.search(scope)
.where((f) -> select).toQuery();
But it works well for:
Map< String , Float > weights = new LinkedHashMap<>(); weights.put( "shoppingName" , 1f);
SimpleQueryParser parser = new SimpleQueryParser( new StandardAnalyzer(), weights, -1);
parser.setDefaultOperator(BooleanClause.Occur.MUST);
Query lcq = parser.parse("rob*);
SearchQuery<Assortment> query = session.search(scope)
.extension(LuceneExtension.get())
.where((f) -> f.fromLuceneQuery(lcq))
.toQuery();
It doesn't seem to make sense to use FieldContextSimpleQueryParser and only introduces errors.
( https://hibernate.atlassian.net/browse/HSEARCH-3845#add-comment?atlOrigin=eyJpIjoiOWQyZjllZWIxZTFmNGUyZmEzZmE2YmRjODdjZjRmOWQiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HSEARCH-3845#add-comment?atlOrigin=eyJpIjoiOWQyZjllZWIxZTFmNGUyZmEzZmE2YmRjODdjZjRmOWQiLCJwIjoiaiJ9 )
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#100121- sha1:0fbe7c1 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200228/4b1bd4ee/attachment.html
More information about the hibernate-issues
mailing list