-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: FullTextSession.createQuery
PostPosted: Mon Nov 17, 2008 10:30 am 
Beginner
Beginner

Joined: Thu Jun 07, 2007 2:38 am
Posts: 28
Location: Italy, Rome
Code:
   
FullTextSession fullTextSession = Search.createFullTextSession(this.getSession());
String hqlQuery = "from EmailAddress e where e.address.value like '%" + searchTerm + "%' " + "or e.type.value like '%" + searchTerm + "%' ";
Query hibQuery = fullTextSession.createQuery(hqlQuery);
List<EmailAddress> result = hibQuery.list();


Question: Will this search use Lucene or the database to find the objects(I suppose the database).

What do I do in order to use HQL and Lucene?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 24, 2008 10:28 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
you have to use different functions to create them:
Code:
createFullTextQuery( luceneQuery )

to make fulltext queries, and
Code:
createQuery( hql )
to make HQL queries ;-)

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.