Re: caching on unique queries

2010-05-25 Thread Chris Hostetter

: Pretty much every one of my queries is going to be unique. However, the 
: query is fairly complex and also contains both unique and non-unique 
: data. In the query, some fields will be unique (e.g description), but 
: other fields will be fairly common (e.g. category). If we could use 
: those common fields as filters, it would be easy to use the filter 
: cache. I could just separate the filters and let the filter cache do its 
: thing. Unfortunately, due to the nature of our application, pretty much 
: every field is just a boost.
...
: Is there anyway to cache part of the query? Or basically cache 
: subqueries? I have my own request handler, so I am willing to write the 
: necessary code. I am fearful that the best performance may be to just 
: turn off caching.

One thing a custom plugin could possibly do in cases like this is to use 
the filterCache to cache the DocSets corripsonding to the re-used 
portions of your queries (on a graunular level) and then wrap those 
DocSets in a Query facade to build them up into a big BooleanQuery -- 
which you should explicitly make sure Solr does not cache (because the 
Query objects will be *huge* if they contain all those DocSets wrapped up)

Note: i did this once a *long* time ago and it wokred out ok, but this may 
be a lot harder now that we have per segment searching/scoring -- i'm not 
sure that the Query/Scorer API gives you everything you need to be able to 
return segment based docIds from a global DocSet.



-Hoss



caching on unique queries

2010-05-19 Thread Kevin Osborn
Pretty much every one of my queries is going to be unique. However, the query 
is fairly complex and also contains both unique and non-unique data. In the 
query, some fields will be unique (e.g description), but other fields will be 
fairly common (e.g. category). If we could use those common fields as filters, 
it would be easy to use the filter cache. I could just separate the filters and 
let the filter cache do its thing. Unfortunately, due to the nature of our 
application, pretty much every field is just a boost.

So, right now, I am getting absolutely no use out of the cache. The only cache 
that might be useful is the Document Cache. Even then I am not sure.

Is there anyway to cache part of the query? Or basically cache subqueries? I 
have my own request handler, so I am willing to write the necessary code. I am 
fearful that the best performance may be to just turn off caching.