: OK.. I have about 100 categories that I want to bitwise AND together with : different searches to get category counts. After the user selects a : category, they will be using other facets based on the particular category. : I was planning to keep my own structure of bitsets for the categories and : let solr handle all other caching with the default filterCache. My question : is: Should I keep my own structure for the 100 bitsets because I always want : these to be around or should I do it another way with a solr defined user : cache?
I don't even think you need a user cache -- the filterCache could probably do everything you wnat (the one reason you might need a user cache is for storing the list of categories and facets -- but if that's not really going to change it can just be a static data structure) when a users search comes in, your RequestHandler can execute it using SolrIndexSearcher.getDocListAndSet(userQuery, null, userSort, start, length) ... the DocList goes in the solr response, and then you can take the DocSet and loop over all of your category queries and use SolrIndexSearcher.numDocs(categoryQuery, yourQueryDocSet) .. SolrIndexSearcher will make sure the DocSets for each individual categoryQueries will be cached. if the user has already picked a category, pass it as the second arg to getDocListAndSet instead of null, and then instead of looping over teh category queries, you can loop over the facet queries for your current category. -Hoss