They'll be in synch forever unless and until you *change* the index. Once
you do anything with an IndexWriter, you have to be very careful about
relying on doc IDs.

But remember that opening a searcher takes a snapshot of the index and
that reader/searcher will NOT see changes. So you could think about
building your cache and using it *as long as you haven't closed/reopened
your index reader*. The cache and search will be in synch for that interval.

Best
Erick

On Fri, Apr 18, 2008 at 9:14 AM, Shailendra Mudgal <
[EMAIL PROTECTED]> wrote:

> Hi Erik Thanks for you prompt reply.
>
> So if i refresh the searcher in every one hour and that time itself if i
> refresh this cache also, is this going to work? I mean will the document
> ids
> will be in sync for that one hour.
>
>
> On Fri, Apr 18, 2008 at 2:02 AM, Erick Erickson <[EMAIL PROTECTED]>
> wrote:
>
> > Doc IDs are NOT permanent. If you don't change your index at all
> > (delete especially, but sometimes adding/optimizing can chage IDs)
> > then you can re-use them. Otherwise not.
> >
> >
> > On Thu, Apr 17, 2008 at 1:45 PM, Shailendra Mudgal <
> > [EMAIL PROTECTED]> wrote:
> >
> > > Hi All,
> > >
> > > I have a small confusion regarding the document ids which we collect
> > using
> > > HitCollector.collect() method. Here is the description of the
> confusion
> > :
> > >
> > > First i created a FieldCache of type <docID, <list of companyIDs>>
> using
> > a
> > > query which collects all the articles which are only a month old. I am
> > > storing them into a map.
> > >
> > > So now my cache has same document id 's associated with their field
> > value
> > > ready in the memory.
> > >
> > > Now suppose for a search which has duration less then a month, i get a
> > > list
> > > of docIds using hit collector. Can i map these document ids to the
> map,
> > > which i created earlier. And use those field values???
> > >
> > >
> > > Any help will be appreciated ....
> > >
> > > Regards,
> > > Shailendra
> > >
> >
>

Reply via email to