[
https://issues.apache.org/jira/browse/SOLR-2429?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
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:
http://www.lucidimagination.com/blog/2009/07/06/ranges-over-functions-in-solr-14/
) also now implements PostFilter.
Examples:
{code}
// 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)
{code}
> ability to not cache a filter
> -----------------------------
>
> Key: SOLR-2429
> URL: https://issues.apache.org/jira/browse/SOLR-2429
> 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: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]