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 "Paul J. Lucas" <pa...@lucasmail.org> on 2009/07/21 01:26:31 UTC

IndexWriter.deleteDocuments(Term) and Field.Store.YES

If I have a field:

	Field f = new Field( "F", "foo", Field.Store.YES,  
Field.Index.NOT_ANALYZED );

can I later do:

	Term t = new Term( "F", "foo" );
	myIndexWriter.deleteDocuments( t );

and have it work even though the field is Field.Store.YES ?  Does the  
YES/NO make any difference as to whether the delete will work?

If YES means the delete won't work, then does that mean that I have to  
have two fields, one with YES and another with NO?

I need it to be YES since I display the value of the field, but the  
delete doesn't seem to work.

- Paul

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


Re: IndexWriter.deleteDocuments(Term) and Field.Store.YES

Posted by Erick Erickson <er...@gmail.com>.
P.S. Storing should be irrelevant.


On Mon, Jul 20, 2009 at 8:13 PM, Erick Erickson <er...@gmail.com>wrote:

> Describe a bit more, please, what "does not seem to work" means.
>
> For instance, if you're searching for the doc and haven't reopened your
> index, you won't see changes.
>
> Better yet, a small, self-contained test case would be even better. I've
> often
> found my problem trying to write a test to illustrate my problem..
>
> Best
> Erick
>
>
> On Mon, Jul 20, 2009 at 7:26 PM, Paul J. Lucas <pa...@lucasmail.org> wrote:
>
>> If I have a field:
>>
>>        Field f = new Field( "F", "foo", Field.Store.YES,
>> Field.Index.NOT_ANALYZED );
>>
>> can I later do:
>>
>>        Term t = new Term( "F", "foo" );
>>        myIndexWriter.deleteDocuments( t );
>>
>> and have it work even though the field is Field.Store.YES ?  Does the
>> YES/NO make any difference as to whether the delete will work?
>>
>> If YES means the delete won't work, then does that mean that I have to
>> have two fields, one with YES and another with NO?
>>
>> I need it to be YES since I display the value of the field, but the delete
>> doesn't seem to work.
>>
>> - Paul
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>

Re: IndexWriter.deleteDocuments(Term) and Field.Store.YES

Posted by Erick Erickson <er...@gmail.com>.
Describe a bit more, please, what "does not seem to work" means.

For instance, if you're searching for the doc and haven't reopened your
index, you won't see changes.

Better yet, a small, self-contained test case would be even better. I've
often
found my problem trying to write a test to illustrate my problem..

Best
Erick

On Mon, Jul 20, 2009 at 7:26 PM, Paul J. Lucas <pa...@lucasmail.org> wrote:

> If I have a field:
>
>        Field f = new Field( "F", "foo", Field.Store.YES,
> Field.Index.NOT_ANALYZED );
>
> can I later do:
>
>        Term t = new Term( "F", "foo" );
>        myIndexWriter.deleteDocuments( t );
>
> and have it work even though the field is Field.Store.YES ?  Does the
> YES/NO make any difference as to whether the delete will work?
>
> If YES means the delete won't work, then does that mean that I have to have
> two fields, one with YES and another with NO?
>
> I need it to be YES since I display the value of the field, but the delete
> doesn't seem to work.
>
> - Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>