I am looking at executing a single solr query and having solr automatically
execute one (or more) additional solr queries (inside solr) as a way to save
some overhead/time.  I am doing this by overriding the SearchComponent.  My
code works and I was looking at ways to optimize the code.

the original query has facets turned on, but I dont want the additional
queries to have facets or sorting turned on.  per the code snippets below,
would the additional queries be executed with facets on or with facets off?

note: I put null in the localparams and params fields of the createParser
(thinking that is where solr would look for the facet parameter, but was
wondering if the facet setting in the req param might somehow get used.

any help appreciated. thx.
--------------------------------
public class MyFacetComponent extends SearchComponent implements
...
  @Override
  public void process(ResponseBuilder rb) throws IOException {
        SolrParams p = rb.req.getParams();
        SolrIndexSearcher searcher = rb.req.getSearcher();
        MyFacetComponent.MyFacetProcessor mfp = new MyFacetProcessor(p, 
searcher);

        // execute code to perform the additional queries
        mfp.getMyFacets(rb, rb.getFieldFlags(), analyzer);
  }
...
  public static class MyFacetProcessor {
    // TODO: why are these class members but other required variables
aren't?
    final SolrIndexSearcher searcher;
    final SolrParams params;

    public MyFacetProcessor(SolrParams params, SolrIndexSearcher searcher) {
      this.searcher = searcher;
      this.params = params;
    }

    public void getMyFacets(ResponseBuilder rb, int flags, Analyzer
analyzer, boolean debugQuery)
                throws IOException {

                SolrQueryRequest req = rb.req;
                ...
                for (int n = 0; n < myquerylist.length; n++) {
                        // code for prepping for new search goes here
                        ...
                        MyQParserPlugin parserPlugin = new MyQParserPlugin();
                        QParser parser = 
parserPlugin.createParser(mynewsearchstr, null, null,
req);
                        DocList results = searcher.getDocList(pfQuery, 
emptyFilterList, null, 0,
0, flags);
                        ...
                }
        }

-- 
View this message in context: 
http://old.nabble.com/question-re-parserPlugin.createParser-parameters-tp26399496p26399496.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to