Bug 1033226

Summary: chap 2.6 Searching
Product: [JBoss] JBoss Data Grid 6 Reporter: Sanne Grinovero <sanne>
Component: DocumentationAssignee: gsheldon
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: high    
Version: 6.2.0CC: gsheldon, jdg-bugs, mgencur
Target Milestone: GA   
Target Release: 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Build Name: 14318, Infinispan Query Guide-6.2-1 Build Date: 21-11-2013 08:29:28 Topic ID: 14248-499531 [Latest]
Last Closed: 2014-01-16 00:02:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Sanne Grinovero 2013-11-21 18:11:17 UTC
Title: Searching

Describe the issue:
"Wrap the query in a org.hibernate.Query to get the required functionality from the Query API." >>> there's no org.hibernate.Query in JDG it should be "org.infinispan.query.CacheQuery"

The example is wrong as it's using Hibernate API.


Suggestions for improvement:
This is the correct example code:


      // create native Lucene query unsing the query DSL
      // alternatively you can write the Lucene query using the Lucene query parser
      // or the Lucene programmatic API. The Infinispan Query DSL is recommended
      QueryBuilder qb = Search.getSearchManager(cache).buildQueryBuilderForClass(Book.class).get();

      org.apache.lucene.search.Query query = qb
        .keyword()
        .onFields("title", "author")
        .matching("Java rocks!")
        .createQuery();

      // wrap Lucene query in a org.infinispan.query.CacheQuery
      CacheQuery cacheQuery = Search.getSearchManager(cache).getQuery(query);

      List list = cacheQuery.list();

Comment 2 gsheldon 2013-11-22 00:50:37 UTC
WIP

Comment 3 gsheldon 2013-11-22 00:58:20 UTC
Removed JPA example. 

Corrected to org.infinispan.query.CacheQuery. Corrected code example as described above.

Comment 4 Misha H. Ali 2014-01-16 00:02:37 UTC
The fix for this bug is now generally released and available here:

https://access.redhat.com/site/documentation/en-US/Red_Hat_JBoss_Data_Grid/6.2/index.html