lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <paul.elsc...@xs4all.nl>
Subject Re: restricting search result
Date Sat, 04 Dec 2004 09:53:34 GMT
Paul, 

On Friday 03 December 2004 23:31, you wrote:
> Hi,
> how yould you restrict the search results for a certain user? I'm

One way to restrict results is by using a Filter.

> indexing all the existing data in my application but there are certain
> access levels so some users should see more results then an other.
> Each lucene document has a field with an internal id and I want to
> restrict on that basis. I tried it with adding a long concatenation of
> my ids ("+locationId:1 +locationId:3 + ...") but this throws a "More
> than 32 required/prohibited clauses in query." exception.
> Any suggestions?

Using a + before each term requires them all, ie. uses AND, which
would normally have an empty result for an Id field.
You might prefer this query concatenation:

+(locationId:1 locationId:3 ...)

It effectively OR's the locationId content query and requires
only one of the terms to match.

In this case using a Filter would probably be better, though.

Regards,
Paul


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


Mime
View raw message