开发者

Lucene: assigning custom ids?

Can I assign my custom ids to Lucene indexed documents instead of automatically generate new ids ?

I'm asking this bec开发者_JAVA百科ause I already have ids in my collection. A specific field is used for that.

thanks


Yes - in fact this is the only way to do it. (Lucene can't generate IDs for you. The thing that it calls "doc IDs" are internal only and are subject to change at Lucene's whim.)

You would just have a field called "myID" or whatever, and mark it as stored.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜