-->
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.  [ 3 posts ] 
Author Message
 Post subject: Use non-id field as DocumentId
PostPosted: Mon Oct 03, 2016 8:28 pm 
Newbie

Joined: Mon Oct 03, 2016 8:08 pm
Posts: 4
Hi, I understand Hibernate Search uses @ID field as Document Id when using JPA. However, in our case, we have a surrogate id as primary key and a natural (business) ID as another field. Because the way our business works, the underlying DB data can be changes in two ways: incremental changes via Hibernate and a overall data replacement via SQL (bypassing Hibernate). No matter how the data is changed, the natural ID should always refer to the same entity in real world. but the surrogate ID will be changes since it is auto generated.

What I want to do is to tell Lucene to index the natural ID rather than the surrogate ID so that even though the underlying data is changed, the search result I got from using the old index is still valid.

Is there a way in Hibernate Search to use a field as DocumentId while having the @ID annotation on another field?


Top
 Profile  
 
 Post subject: Re: Use non-id field as DocumentId
PostPosted: Tue Oct 04, 2016 2:45 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1630
Location: Romania
I think that the Hibernate Search and Validator board is where you should post this question.


Top
 Profile  
 
 Post subject: Re: Use non-id field as DocumentId
PostPosted: Tue Oct 04, 2016 8:13 pm 
Newbie

Joined: Mon Oct 03, 2016 8:08 pm
Posts: 4
vlad wrote:
I think that the Hibernate Search and Validator board is where you should post this question.


Thanks for the heads up. I reposted it here.
Think this thread can be deleted


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