I am new to both lucene and hibernate search. I have managed to make hibernate search working in my project.
I have managed to index such a entity:
Code:
@Indexed
@Entity
@Table(name = "tb_product")
public class Product {
private long id;
@Id
@DocumentId
public Long getId() {
return id;
}
...
}
Now I have a new requirement: a fulltext search should be happen on products within a specified set of ids(these ids are fetched by somewhere else).
Because the the query result need to be paginated, I wouldn't like to run the full query and filter out the result one by one. Now I am trying to build a Filter to let the query itself to do the filtering , but I failed build a DocIdSet corresponding to the product id because I don't know how to accept the documentid in query. Could anyone give some hint on how to access the product id in a lucene query? Or give the right direction of implement this?