-->
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.  [ 5 posts ] 
Author Message
 Post subject: Get Lucene document number
PostPosted: Wed Mar 14, 2012 6:44 am 
Newbie

Joined: Wed Mar 07, 2012 12:21 pm
Posts: 6
Location: Zürich
Hopefully a simple question. Is it possible to get the Lucene document (number) associated to an entity?


Top
 Profile  
 
 Post subject: Re: Get Lucene document number
PostPosted: Wed Mar 14, 2012 7:43 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
sure, but you need to make a fulltext query. Just search for the entity by primary key, and then use projections to load FullTextQuery.DOCUMENT_ID as in
http://docs.jboss.org/hibernate/search/ ... rojections

Remember that the document id is likely to change when writes happen to the index.

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


Top
 Profile  
 
 Post subject: Re: Get Lucene document number
PostPosted: Thu Mar 15, 2012 11:11 am 
Newbie

Joined: Wed Mar 07, 2012 12:21 pm
Posts: 6
Location: Zürich
Perfect, thank you very much.


Top
 Profile  
 
 Post subject: Re: Get Lucene document number
PostPosted: Mon Mar 26, 2012 6:59 pm 
Newbie

Joined: Mon Mar 26, 2012 6:30 pm
Posts: 3
I wonder if this might be useful to do what i'm trying here https://forum.hibernate.org/viewtopic.php?f=9&t=1014909 Is the DOCUMENT_ID the same number used to create the Lucene index files?


Top
 Profile  
 
 Post subject: Re: Get Lucene document number
PostPosted: Mon Mar 26, 2012 7:13 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
I wonder if this might be useful to do what i'm trying here viewtopic.php?f=9&t=1014909 Is the DOCUMENT_ID the same number used to create the Lucene index files?

No, not related.

_________________
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.  [ 5 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.