Hello, I'm overwriting getFacetInfo(...) method from standard request handler (BTW: thanks for making a separate method for faceting :-)) What I need is to ran original query several times with filter query which I generate based on result from original query. Bellow is part of my code. I was thinking may be I could run those queries not one by one but in parallel, in separate threads. But it appears that it takes longer than to run queries one by one. Do you have any idea why? Do you think the idea to run those queries in separate threads is good in general? Are SolrIndexSearcher and SimpleFacets thread safe?
Thank you Gene ------------------------------------------------------------------ protected NamedList getFacetInfo(SolrQueryRequest req, SolrQueryResponse rsp, DocSet mainSet) { SimpleFacets f = new SimpleFacets(req.getSearcher(), mainSet, req.getParams()); NamedList facetInfo = f.getFacetCounts(); ////////////////// This is custom code for multi facets .................. ........ Truncated .................. for (int i = 0; i < shortFld.size(); i++) { SolrQueryParser qp = new SolrQueryParser(s.getSchema(), null); Query q = qp.parse(shortFldName + ":" + shortFld.getName(i)); filters.add(q); DocListAndSet matrixRes = s.getDocListAndSet(query, filters, null, 0, 0, flags); NamedList matr = new SimpleFacets(req.getSearcher(), matrixRes.docSet, req.getParams()).getFacetCounts(); facetFields.add(shortFld.getName(i), matr.get("facet_fields")); filters.remove(q); } .................. ........ Truncated .................. return facetInfo; }