lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley (JIRA)" <>
Subject [jira] [Updated] (SOLR-2429) ability to not cache a filter
Date Fri, 24 Jun 2011 01:43:47 GMT


Yonik Seeley updated SOLR-2429:

    Attachment: SOLR-2429.patch

Here's a patch that allows one to add cache=false to top level queries (main queries, filter
queries, facet queries, etc).

Currently (without this patch) Solr generates the set of documents that match each filter
individually (this is so they can be cached and reused).

Adding cache=false to the main query prevents lookup/storing in the query cache.  Adding cache=false
to any filter query causes the filterCache to not be used.  Further, the filter query is actually
run in parallel to the main query and any other non-cached filter queries (which can speed
things up if the base query or other filter queries are relatively sparse).

There is also an optional "cost" parameter that controls the order in which non-cached filter
queries are evaluated so knowledgable users can order less expensive non-cached filters before
expensive non-cached filters.

As an additional feature for very high cost filters, if cache=false and cost>=100 and the
query implements the PostFilter interface, a Collector will be requested from that query and
used to filter documents after they have matched the main query and all other filter queries.
 There can be multiple post filters, and they are also ordered by cost.

The frange query (a range over function queries, background here:
) also now implements PostFilter.

// normal function range query used as a filter, all matching documents generated up front
and cached
fq={!frange l=10 u=100}mul(popularity,price)

// function range query run in parallel with the main query like a traditional lucene filter
fq={!frange l=10 u=100 cache=false}mul(popularity,price)

// function range query checked after each document that already matches the query and all
other filters.  Good for really expensive function queries. 
fq={!frange l=10 u=100 cache=false cost=100}mul(popularity,price)

> ability to not cache a filter
> -----------------------------
>                 Key: SOLR-2429
>                 URL:
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Yonik Seeley
>         Attachments: SOLR-2429.patch
> A user should be able to add {!cache=false} to a query or filter query.

This message is automatically generated by JIRA.
For more information on JIRA, see:


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

View raw message