Re: I need the internal lucene's document id from Hits

2007-04-05 Thread Mohammad Norouzi
ŮŚWell Philipp and Ronnie Thank you very much indeed -- Regards, Mohammad

Re: I need the internal lucene's document id from Hits

2007-04-05 Thread Philipp Nanz
As long as there are no deletions, the ids will remain unchanged and it is safe to use them outside. But in a case where you delete some document, the resulting gap in the document list will be filled during the next optimize (triggered manually) or merge operation (may be triggered automatically

Re: I need the internal lucene's document id from Hits

2007-04-05 Thread Mohammad Norouzi
Thanks Philipp 2007/4/5, Philipp Nanz <[EMAIL PROTECTED]>: > That *is* the actual id in the index. There is no other. > You should be careful using it outside of Lucene though, because > Lucene may rearrange the document ids during optimization for example. > > If you need an application id, ad

Re: I need the internal lucene's document id from Hits

2007-04-05 Thread Philipp Nanz
Ahh, now i know what you mean... Forget the above :-) Use result.id( i ) 2007/4/5, Philipp Nanz <[EMAIL PROTECTED]>: That *is* the actual id in the index. There is no other. You should be careful using it outside of Lucene though, because Lucene may rearrange the document ids during optimizati

Re: I need the internal lucene's document id from Hits

2007-04-05 Thread Ronnie Kolehmainen
It's in the FAQ: http://wiki.apache.org/lucene-java/LuceneFAQ#head-e1de2630fe33fb6eb6733747a5bf870f600e1b4c Mohammad Norouzi wrote: but the question is, if I add, say, a document to my index, is lucene going to re arrange the internal IDs? can't I trust them? Would you tell me in exactly which

Re: I need the internal lucene's document id from Hits

2007-04-05 Thread Philipp Nanz
That *is* the actual id in the index. There is no other. You should be careful using it outside of Lucene though, because Lucene may rearrange the document ids during optimization for example. If you need an application id, add it as an additional stored field to each document and retrieve that.

Re: I need the internal lucene's document id from Hits

2007-04-05 Thread Mohammad Norouzi
sorry to correct my answer: I need something like this result.doc( i ).getId(); this id from the result (the i ) is starting from 1 but I need the actual id in the index. On 4/5/07, Mohammad Norouzi <[EMAIL PROTECTED]> wrote: Hi I need the id of the document that returned by Hits as a result