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 Josh Joy <jo...@yahoo.com> on 2006/09/27 04:04:13 UTC

Multiple Terms, Delete From Index

Hi All,

I need to delete from the index where 2 terms are
matching, rather than 
just one term.
For example,

IndexReader reader = IndexReader.open(dir);
Term[] terms = new Term[2];
terms[0] = new Term("city","city1");
terms[1] = new Term("state","state1");
reader.delete(terms);
reader.close();

Any suggestions?

Thanks in advance,
Josh

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


Re: Multiple Terms, Delete From Index

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Iterate through all Hits for "city:city1 AND state:state1" and delete  
them by document ID.

	Erik


On Sep 26, 2006, at 10:04 PM, Josh Joy wrote:

> Hi All,
>
> I need to delete from the index where 2 terms are
> matching, rather than
> just one term.
> For example,
>
> IndexReader reader = IndexReader.open(dir);
> Term[] terms = new Term[2];
> terms[0] = new Term("city","city1");
> terms[1] = new Term("state","state1");
> reader.delete(terms);
> reader.close();
>
> Any suggestions?
>
> Thanks in advance,
> Josh
>
> ---------------------------------------------------------------------
> 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