Issue Type: Bug Bug
Affects Versions: 4.2.0.Final
Assignee: Unassigned
Components: documentation
Created: 06/Mar/13 6:17 PM
Description:

Getting Started Section: 1.5 Searching

Example 1.9. Using Hibernate Session to create and execute search

There is an error in the example code.
On the line ".matching("Java Rocks!"); the ; should not be there

FullTextSession fullTextSession = Search.getFullTextSession(session);
Transaction tx = fullTextSession.beginTransaction();

// 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 Hibernate Search DSL is recommended though
QueryBuilder qb = fullTextSession.getSearchFactory()
    .buildQueryBuilder().forEntity( Book.class ).get();
org.apache.lucene.search.Query query = qb
  .keyword()
  .onFields("title", "subtitle", "authors.name")
  .matching("Java rocks!");
  .createQuery();

// wrap Lucene query in a org.hibernate.Query
org.hibernate.Query hibQuery = 
    fullTextSession.createFullTextQuery(query, Book.class);

// execute search
List result = hibQuery.list();
  
tx.commit();
session.close();
Project: Hibernate Search
Labels: documentation search
Priority: Major Major
Reporter: Albert Ferguson
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira