-->
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.  [ 4 posts ] 
Author Message
 Post subject: Getting the matching identifiers in Lucene
PostPosted: Mon Apr 06, 2009 4:12 am 
Beginner
Beginner

Joined: Tue Feb 03, 2009 12:29 pm
Posts: 49
This is regarding a statement in Hibernate search in Action book -
Quote:
Always remember that you can go back to plain HQL or work in a three-step process: Apply part of the query (the discriminant part) in Lucene, collect the matching identifiers, and run an HQL query that restricts by these identifiers and some other criteria.

How do we get the matching identifiers in Lucene using the Hibernate search API? I could not find any method for doing that.

Thanks,
Seema


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 06, 2009 6:40 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

You could use projections projecting on FullTextQuery.ID. With the returned ids you can then build the criteria query.

--Hardy


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 06, 2009 8:01 am 
Beginner
Beginner

Joined: Tue Feb 03, 2009 12:29 pm
Posts: 49
Thanks, I'm using JPA with Hibernate as the provider and not plain Hibernate. Hope this works with JPA as well. I will try this.

-Seema


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 06, 2009 8:47 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Sure it will work. I am not talking Hibernate projection, but Hibernate Search projection ;-) The the Hibernate Search online manual - http://www.hibernate.org/hib_docs/searc ... ml_single/

--Hardy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.