lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philipp Nanz" <phili...@gmail.com>
Subject Re: I need the internal lucene's document id from Hits
Date Thu, 05 Apr 2007 10:41:09 GMT
Ahh, now i know what you mean...

Forget the above :-)

Use result.id( i )

2007/4/5, Philipp Nanz <philippn@gmail.com>:
> 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.
>
> Hope this helps
> Philipp
>
> 2007/4/5, Mohammad Norouzi <mnrz57@gmail.com>:
> > 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 <mnrz57@gmail.com> wrote:
> > >
> > >
> > > Hi
> > > I need the id of the document that returned by Hits as a result of a
> > > query.
> > >
> > > Hits result = searchable.find(myQuery....);
> > >
> > > now I need something like result.getId ()
> > >
> > > is there any way to get it?
> > >
> > > Thanks so much
> > >
> > > --
> > > Regards,
> > > Mohammad Norouzi
> > >
> >
> >
> >
> > --
> > Regards,
> > Mohammad
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message