/**
   * factory method for invoking json facet framework as whole. Note: this is currently only used
   * from SimpleFacets, not from JSON Facet API itself.
   */
  public static FacetProcessor<?> createProcessor(
      SolrQueryRequest req, Map<String, Object> params, DocSet docs) {
    FacetParser parser = new FacetTopParser(req);
    FacetRequest facetRequest = null;
    try {
      facetRequest = parser.parse(params);
    } catch (SyntaxError syntaxError) {
      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, syntaxError);
    }

    FacetContext fcontext = new FacetContext();
    fcontext.base = docs;
    fcontext.req = req;
    fcontext.searcher = req.getSearcher();
    fcontext.qcontext = QueryContext.newContext(fcontext.searcher);

    return facetRequest.createFacetProcessor(fcontext);
  }
Example #2
0
 public SolrQueryRequest getSolrRequest() {
   return parent.getSolrRequest();
 }
Example #3
0
 public IndexSchema getSchema() {
   return parent.getSchema();
 }
Example #4
0
 public String getPathStr() {
   if (parent == null) {
     return "/" + key;
   }
   return parent.getKey() + "/" + key;
 }