You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Chris Bamford <ch...@talktalk.net> on 2011/05/20 17:30:22 UTC
How to delete docs when using NRT?
Hi there,
Is there something special I should be doing here? This is my sequence:
open writer
add doc #1
add doc #2
get reader from writer
do a search on reader - matches doc #1
delete doc #1 from writer
commit writer
add doc #3
optimise writer
close writer
So by my reckoning, my index should contain docs 2 & 3.
Luke says different - all 3 are there! Why hasn't doc #1 gone?
Have I missed something?
Thanks,
- Chris
Re: How to delete docs when using NRT?
Posted by Michael McCandless <lu...@mikemccandless.com>.
Phew :) Thanks for bringing closure Chris,
Mike
http://blog.mikemccandless.com
On Fri, May 20, 2011 at 12:29 PM, Chris Bamford
<ch...@talktalk.net> wrote:
>
> Mike - my bad. I store my ids as numeric, and I was trying to delete using a string termquery. Got it working now.
>
> Thanks anyway
>
> - Chris
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Michael McCandless <lu...@mikemccandless.com>
> To: java-user@lucene.apache.org
> Sent: Fri, 20 May 2011 16:50
> Subject: Re: How to delete docs when using NRT?
>
>
> That should have worked.
>
> There's nothing special about deleting docs when using NRT reader.
>
> Can you boil it down to a test case?
>
> Mike
>
> http://blog.mikemccandless.com
>
> On Fri, May 20, 2011 at 11:30 AM, Chris Bamford
> <ch...@talktalk.net> wrote:
>> Hi there,
>>
>> Is there something special I should be doing here? This is my sequence:
>>
>> open writer
>> add doc #1
>> add doc #2
>> get reader from writer
>> do a search on reader - matches doc #1
>> delete doc #1 from writer
>> commit writer
>> add doc #3
>> optimise writer
>> close writer
>>
>> So by my reckoning, my index should contain docs 2 & 3.
>> Luke says different - all 3 are there! Why hasn't doc #1 gone?
>>
>> Have I missed something?
>>
>> Thanks,
>>
>> - Chris
>>
>>
>>
>>
>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: How to delete docs when using NRT?
Posted by Chris Bamford <ch...@talktalk.net>.
Mike - my bad. I store my ids as numeric, and I was trying to delete using a string termquery. Got it working now.
Thanks anyway
- Chris
-----Original Message-----
From: Michael McCandless <lu...@mikemccandless.com>
To: java-user@lucene.apache.org
Sent: Fri, 20 May 2011 16:50
Subject: Re: How to delete docs when using NRT?
That should have worked.
There's nothing special about deleting docs when using NRT reader.
Can you boil it down to a test case?
Mike
http://blog.mikemccandless.com
On Fri, May 20, 2011 at 11:30 AM, Chris Bamford
<ch...@talktalk.net> wrote:
> Hi there,
>
> Is there something special I should be doing here? This is my sequence:
>
> open writer
> add doc #1
> add doc #2
> get reader from writer
> do a search on reader - matches doc #1
> delete doc #1 from writer
> commit writer
> add doc #3
> optimise writer
> close writer
>
> So by my reckoning, my index should contain docs 2 & 3.
> Luke says different - all 3 are there! Why hasn't doc #1 gone?
>
> Have I missed something?
>
> Thanks,
>
> - Chris
>
>
>
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: How to delete docs when using NRT?
Posted by Michael McCandless <lu...@mikemccandless.com>.
That should have worked.
There's nothing special about deleting docs when using NRT reader.
Can you boil it down to a test case?
Mike
http://blog.mikemccandless.com
On Fri, May 20, 2011 at 11:30 AM, Chris Bamford
<ch...@talktalk.net> wrote:
> Hi there,
>
> Is there something special I should be doing here? This is my sequence:
>
> open writer
> add doc #1
> add doc #2
> get reader from writer
> do a search on reader - matches doc #1
> delete doc #1 from writer
> commit writer
> add doc #3
> optimise writer
> close writer
>
> So by my reckoning, my index should contain docs 2 & 3.
> Luke says different - all 3 are there! Why hasn't doc #1 gone?
>
> Have I missed something?
>
> Thanks,
>
> - Chris
>
>
>
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org