-->
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.  [ 1 post ] 
Author Message
 Post subject: How to map documentid to Hibernate search entity
PostPosted: Wed Sep 10, 2014 4:08 pm 
Newbie

Joined: Wed Sep 10, 2014 4:00 pm
Posts: 1
Hi everyone,

I have an entity with documentid

@Indexed
@Analyzer(impl = EnglishAnalyzer.class)
@Entity
@Table(name = "Tag", schema = "cpsc")
public class Tag extends BaseObject {

public static final String NAME_FIELD = "name";

@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "uuidGenerator")
@GenericGenerator(name = "uuidGenerator", strategy = "mypackage.UuidGenerator")
@Column(name = ID_FIELD)
@DocumentId
private Long id;

...

My generator will create an unique Long id and stores it to the database after save.

But how can i get documentid in lucene or set is the same as my entity id?
it would be very useful to get a field with lucene document id.

The main reason why i need it is getting term from index for the entity for this i need the lucene id.
Maybe there is another way to get terms?

Thanks for any advice.


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

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.