lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: ParallelReader
Date Fri, 15 Oct 2010 01:35:27 GMT
This seems like far too much work if I'm reading things right. You can't
update
a field, but you #can# update a document which actually re-index that
document
under the covers (you have to have a way to uniquely identify the doc).
Then, when
you reopen your index reader, you'll only see the new value for the one
field that's
different. This doesn't rely on any second index at all.

So is there something I'm missing here that caused you to take the route
you're
taking? Because I'd just try updating the document and reopening the reader
first...

HTH
Erick

On Thu, Oct 14, 2010 at 9:06 PM, Nilesh Vijaywargiay <nilesh.vijay@gmail.com
> wrote:

> Hey Erick, Sure.
> *
> *
> *What I am trying to achieve:*
>
> A) Update a field in Index A
> B) When searching for that old field, it should be a miss.
>
> *How I achieved it*
>
> *Index 1 *
> Doc 1 - Field1, Value 1
> Doc 2 - Field1, Value 1
>
> *Index 2*
> Doc 1 - Field1, Modified_Value 1
> Doc 2 - EMPTY
>
> Add index 2 before Index 1 in the parallel reader.
> In short, I am creating a new index with same number of documents but all
> the documents are empty except the ones I want to update.
>
> *RESULTS:*
> If I search for Field1:Value1, I get a miss[What I wanted]
> If I search for Field1:Modified_Value 1, I get a hit[What I wanted]
>
> *PROBLEM*
> I am kinda finding it surprising that I am able to update a field[I was
> told
> I can't]. Ofcourse there is downside of creating a new index with dummy
> documents which might be huge. But apart from that, Is there something
> fishy
> about it? Any case where it would break?
>
>
>
> On Thu, Oct 14, 2010 at 5:55 PM, Erick Erickson <erickerickson@gmail.com
> >wrote:
>
> > No. And you don't even want to try... Document IDs are NOT invariant.
> > Particularly
> > when you delete a document and optimize an index, all the documents that
> > come
> > after the deleted one get new doc IDs. Trying to keep these two indexes
> in
> > synch
> > will be a nightmare.
> >
> > Perhaps you could explain what you're trying to accomplish and we could
> > suggest
> > other approaches. See:
> >
> > http://people.apache.org/~hossman/#xyproblem
> >
> > Your question appears to be an "XY Problem" ... that is: you are dealing
> > with "X", you are assuming "Y" will help you, and you are asking about
> "Y"
> > without giving more details about the "X" so that we can understand the
> > full issue.  Perhaps the best solution doesn't involve "Y" at all?
> > See Also: http://www.perlmonks.org/index.pl?node_id=542341
> >
> > Best,
> > Erick
> >
> > On Thu, Oct 14, 2010 at 11:42 AM, Nilesh Vijaywargiay <
> > nilesh.vijay@gmail.com> wrote:
> >
> > > I have two index, A and B. Can two documents doc1[in index A] and
> doc2[in
> > > index B] have a common field? doc1 and doc2 have same document Id's.
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message