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:
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,
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
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
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
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
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