Bug 1033226 - chap 2.6 Searching
Summary: chap 2.6 Searching
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Data Grid 6
Classification: JBoss
Component: Documentation
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: GA
: 6.2.0
Assignee: gsheldon
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-21 18:11 UTC by Sanne Grinovero
Modified: 2014-01-16 00:02 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
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


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.