Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
9.0
-
None
-
None
Description
I noticed that I was getting far more entries in the filterCache than I was expecting. All my app's FQs are driven by the app itself. There are only a couple dozen FQs possible in our queries, but I'd be getting ~10K cache ejections every hour. That didn't make any sense.
So I investigated and discovered that making a query using facets adds an entry to the filterCache. Here's my demonstration.
The script show-results is this:
{{curl -s "$URL/twit/admin/cache" | jq -S .queries
curl -s "$URL/admin/metrics" | jq '.metrics."solr.core.twit"."CACHE.searcher.filterCache".inserts'
}}
The /admin/cache handler is Shawn Heisey's cache dumper he's working on in ticket SOLR-15859.
{{# Freshly started Solr. No cache entries.
$ ./show-results
{}
0
- Query on "alpha" with facets on.
$ curl -s $URL/twit/select?q=title:alpha&rows=0&facet=on&facet.field=grouping
- Now there is a filter cache entry.
$ ./show-results { "title:alpha": 0 }1
- Query on "beta" with facets on. "beta" shows up in the cache.
$ curl -s $URL/twit/select?q=title:beta&rows=0&facet=on&facet.field=grouping
$ ./show-results
{ "title:alpha": 0, "title:beta": 0 }2
- Now query on "gamma" with facets OFF.
$ curl -s $URL/twit/select?q=title:gamma&rows=0&facet=off&facet.field=grouping
- The "gamma" does not show up in the filter cache.
$ ./show-results { "title:alpha": 0, "title:beta": 0 }2
- Now do same query on "gamma" with facets ON.
$ curl -s $URL/twit/select?q=title:gamma&rows=0&facet=on&facet.field=grouping
- The "gamma" shows up.
$ ./show-results { "title:alpha": 0, "title:beta": 0, "title:gamma": 0 }3
}}
Is this correct behavior? Do I need to adjust my filterCache to allow for this?