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 Ben <ne...@gmail.com> on 2005/04/25 14:18:22 UTC

Delete documents base on more than one condition?

Hi

Is it possible to delete a set of documents where they match certain
conditions? I would like to delete a set of articles that belong to a
given user within a category.

Thanks,
Ben

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


Re: Delete documents base on more than one condition?

Posted by Jens Kraemer <kr...@webit.de>.
On Mon, Apr 25, 2005 at 10:18:22PM +1000, Ben wrote:
> Hi
> 
> Is it possible to delete a set of documents where they match certain
> conditions? I would like to delete a set of articles that belong to a
> given user within a category.

just build a query reflecting your criteria (e.g. a BooleanQuery
containing two TermQueries, one for category and one for the user
field), run a search with this query, walk through the search results
and delete each of them.

Jens

-- 
webit! Gesellschaft für neue Medien mbH          www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer       kraemer@webit.de
Schnorrstraße 76                      Telefon +49 351 46766 0
D-01069 Dresden                      Telefax +49 351 46766 66

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