lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Question to Lucene Index
Date Mon, 27 Feb 2006 13:38:48 GMT

On Feb 27, 2006, at 4:06 AM, Thomas Papke wrote:

> Thank you for all your good answers
> The restriction i want to search with looks somethinks like this:
> I want to do some searching for A in diffenerent Fields and i want  
> to prohibite some user/usergroups specific field values. I am right  
> to do it in this way:
> BooleanQuery q1 = new BooleanQuery();
> q1.add(new TermQuery(new Term("field", "B"), false, true);
> q1.add(new TermQuery(new Term("field", "C"), false, true);
>    ...
> q2 = new BooleanQuery();
> q2.add(new TermQuery(new Term("field", "A"), true, false);
> q2.add(q1, false, true);
> Or is there an better way to prohibite something? Filters maybe?  
> Anyone a short example how to implement a lucene filter?

The code to Lucene in Action, available for free at http://, has Filter examples.  One such example is a  
SecurityFilter that prohibits a user from seeing documents that he/ 
she does not "own" (a contrived example).  Wouldn't hurt our feelings  
if you purchased the book too :))


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message