Bug 1238866

Summary: Problem in dealing with the HQL queries that contain string comparison operations, when it involves empty string as an operand
Product: [JBoss] JBoss Data Grid 6 Reporter: Adrian Nistor <anistor>
Component: InfinispanAssignee: Tristan Tarrant <ttarrant>
Status: VERIFIED --- QA Contact: Martin Gencur <mgencur>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.5.0, 6.4.0, 6.6.0CC: jdg-bugs, ttarrant
Target Milestone: DR1   
Target Release: 6.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1246688 (view as bug list) Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1246688    
Attachments:
Description Flags
Issue reproducer none

Description Adrian Nistor 2015-07-02 20:33:32 UTC

Comment 5 JBoss JIRA Server 2015-07-24 11:01:44 UTC
Adrian Nistor <anistor> updated the status of jira ISPN-5561 to Reopened

Comment 7 Matej Čimbora 2015-08-07 08:02:00 UTC
Created attachment 1060258 [details]
Issue reproducer

Comment 8 Matej Čimbora 2015-08-07 08:04:15 UTC
Looks like I'm still hitting the issue, attached reproducer.

1. unzip reproducer.zip
2. mvn clean install -s /path/to/settings.xml
3. mvn exec:java -s /path/to/settings.xml -Dexec.mainClass=QueryVfMain

Comment 9 Adrian Nistor 2015-08-07 13:32:51 UTC
Matej, what issue are you experiencing?
The reproducer seems to use the hibernate-search DSL to build a Lucene query object, but please note this BZ and the associated ISPN-5561 are actually referring to infinispan's DSL based queries, used in remote mode, embedded mode, compat mode. The description of ISPN-5561 is unfortunately terribly wordy and describes the HQL parser issue in terms of the Lucene query being built (wrongly, due to term analysis) behind the scene with some hibernate-search DSL invocation examples, but that's not what this bug is about. Or do we have a problem at the hibernate-search DSL level? I did not run the reproducer yet as there seems to be a compile error.

Comment 10 Matej Čimbora 2015-08-07 13:54:19 UTC
Hi Adrian, sorry for confusion. The issue I'm getting copies the one described in attached JIRA, i.e. 

org.hibernate.search.errors.EmptyQueryException: HSEARCH000146: The query string '' applied on field 'text' has no meaningfull tokens to be matched. Validate the query input against the Analyzer applied on this field.
	at org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsTermQueryBuilder.createQuery(ConnectedMultiFieldsTermQueryBuilder.java:111)
	at org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsTermQueryBuilder.createQuery(ConnectedMultiFieldsTermQueryBuilder.java:81)
	at QueryVfMain.main(QueryVfMain.java:32)

I've just run the reproducer without problems, maybe you're missing 6.4.0.DR1-redhat-1 artifacts in your maven repository?

In that case I'll make sure the issue doesn't occur when using ISPN DSL based queries. If that's the case, I'll move this issue to verified state. However the reproducer still deserves investigation, please let me know if you have any problems while making it work.

Comment 11 Matej Čimbora 2015-08-07 14:28:28 UTC
Looks like using ISPN Query DSL works fine.

Comment 12 Matej Čimbora 2015-08-10 07:29:34 UTC
Marking as verified as per https://bugzilla.redhat.com/show_bug.cgi?id=1238866#c9 & https://bugzilla.redhat.com/show_bug.cgi?id=1238866#c10. The issue was related to using ISPN DSL based queries.