Can I assign my custom ids to Lucene indexed documents instead of automatically generate new ids ?
I’m asking this because I already have ids in my collection. A specific field is used for that.
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.