lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nico Krijnen <>
Subject folder path prefix filtering
Date Tue, 05 Aug 2008 07:40:13 GMT

Need some help with prefix filtering...
We ran into the max clause count problem with our usage of the  
wildcard query. Essentially what we are trying to do is:

One of the fields in our index contains a 'path' representing a file  
system location. For example:

/folder A/subfolder/document 1.pdf
/folder B/image 1.jpg
/folder B/image 2.jpg
/folder B2/image 3.jpg
/folder C/image 4.jpg

We have a security layer in our application that filters results based  
on the users permissions. These permissions (VIEW, EDIT, ...) can be  
set on 'folder paths'. To filter the results we build a bool query  
with a wildcard (or prefix) query for each folder for which the user  
has VIEW permissions, for example:

/folder A/subfolder/*
/folder B/*
/folder B2/*

This does exactly what we want to, but because a wildcard query is  
rewritten to term queries it fails when there are more then 1024  
documents below a folder (max clause count of rewritten bool query).  
After all, each document has a different (untokenized) term value for  
the 'path' field.

After searching the web we found some alternative methods, for example  
by using a PrefixFilter wrapped in a CachingWrapperFilter instead of a  
query. Before we start implementing I'd like to check if anyone here  
may have some more experience with queries like this or may have a  
better suggestion on how to approach this?

Kind regards,
Nico Krijnen

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

View raw message