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.
|