lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lance Norskog <>
Subject Re: Modelling Access Control
Date Tue, 26 Oct 2010 07:06:07 GMT
Filter queries are a set of bits which is ANDed against query results
at a very early stage of query processing. They are very useful.  Note
that they are stored (I think) in parsed query order, so you have to
pass in the same filter query string each time.

On Mon, Oct 25, 2010 at 8:59 AM, Dennis Gearon <> wrote:
> Thanks for that insight, a lot.
> Dennis Gearon
> Signature Warning
> ----------------
> It is always a good idea to learn from your own mistakes. It is usually a better idea
to learn from others’ mistakes, so you do not have to make them yourself. from ''
> EARTH has a Right To Life,
>  otherwise we all die.
> --- On Mon, 10/25/10, Jonathan Rochkind <> wrote:
>> From: Jonathan Rochkind <>
>> Subject: Re: Modelling Access Control
>> To: "" <>
>> Date: Monday, October 25, 2010, 8:19 AM
>> Dennis Gearon wrote:
>> > why use filter queries?
>> >
>> > Wouldn't reducing the set headed into the filters by
>> putting it in the main query be faster? (A question to
>> learn, since I do NOT know :-)
>> >
>> >
>> No. At least as I understand it. In the best case, the
>> filter query will be a lot faster, because filter queries
>> are cached seperately in the filter cache.  So if the
>> existing filter query can be found in the cache, it'll be a
>> lot faster. If it's not in the cache, the performance should
>> be pretty much the same as if you had included it as an
>> additional clause in the main q query.
>> The reasons to put it in a fq filter are:
>> 1) The caching behavior. You can have that certain part of
>> the query be cached on it's own, speeding up any subsequent
>> queries that use that same fq.
>> 2) Simplification of client code. You can leave your 'q'
>> however you want it, using whatever kind of query parser you
>> want too (dismax, whatever), and just add on the 'fq'
>> without touching the 'q'.   This is a lot
>> easier to do, and especially when you're using it for access
>> control like this, a lot harder for a bug to creep in.
>> Jonathan

Lance Norskog

View raw message