Re: getting Lucene Docid from inside score()

2018-03-10 Thread Erick Erickson
I was thinking this was a Solr question rather than a Lucene one so the [docid] bit doesn't apply if you're in the lucene code. If you _are_ really going from solr, just put [docid] in your Solr "fl" list. Look in the Solr ref guide for an explanation:

Re: getting Lucene Docid from inside score()

2018-03-10 Thread dwaipayan . roy
Hi Erick, Many thanks for your reply and explanation. I really want this to work. The good news for me is, the index is static, there is no chance of any modification of the index. > Luke and the like are using a point-in-time snapshot of the index. I want to get that lucene-assigned docid,

Re: getting Lucene Docid from inside score()

2018-03-09 Thread Erick Erickson
You almost certainly do _not_ want this unless you are absolutely and totally sure that your index does not change between the time you ask for for the internal Lucene doc ID and the time you use it. No docs may be added. No forceMerges are done. In fact, I'd go so far as to say you shouldn't open

Re: getting Lucene Docid from inside score()

2018-03-09 Thread dwaipayan . roy
Thank you very much for your reply. Yes, I really want this (for implementing a retrieval function that extends the LMDir function). Precisely, I want the document numbering same as that we see in Lucene-Index-Viewers like Luke. I am not sure what you meant by "segment offset, held by a leaf

Re: getting Lucene Docid from inside score()

2018-03-09 Thread Dwaipayan Roy
Thank you very much for your reply. Yes, I really want this (for implementing a retrieval function that extends the LMDir function). Precisely, I want the document numbering same as that we see in Lucene-Index-Viewers like Luke. I am not sure what you meant by "segment offset, held by a leaf

Re: getting Lucene Docid from inside score()

2018-03-09 Thread Michael Sokolov
Are you sure you want this? Lucene docids aren't generally useful outside a narrow internal context. They can change over time for example. But if you do, it sounds like maybe what you are seeing is the per segment docid. To get a global one you have to add the segment offset, held by a leaf

getting Lucene Docid from inside score()

2018-03-09 Thread Dwaipayan Roy
While searching, I want to get the lucene assigned docid (that starts from 0 to the number of documents -1) of a document having a particular query term. >From inside the score(), printing 'doc' or calling docId() is returning a docid which, I think, is the internal docid of a segment in which