Class AlfrescoSearchHandler

java.lang.Object
org.apache.solr.handler.RequestHandlerBase
org.apache.solr.handler.component.AlfrescoSearchHandler
All Implemented Interfaces:
org.apache.solr.api.ApiSupport, org.apache.solr.core.SolrInfoMBean, org.apache.solr.handler.NestedRequestHandler, org.apache.solr.metrics.SolrMetricProducer, org.apache.solr.request.SolrRequestHandler, org.apache.solr.util.plugin.PluginInfoInitialized, org.apache.solr.util.plugin.SolrCoreAware

public class AlfrescoSearchHandler extends org.apache.solr.handler.RequestHandlerBase implements org.apache.solr.util.plugin.SolrCoreAware, org.apache.solr.util.plugin.PluginInfoInitialized
Author:
Andy
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoMBean

    org.apache.solr.core.SolrInfoMBean.Category, org.apache.solr.core.SolrInfoMBean.Group
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected List<org.apache.solr.handler.component.SearchComponent>
     
    static final String
     
    static final String
    Facet SOLR Queries are omitting facet results with count equals to 0 as general rule.

    Fields inherited from class org.apache.solr.handler.RequestHandlerBase

    appends, defaults, httpCaching, initArgs, invariants

    Fields inherited from interface org.apache.solr.request.SolrRequestHandler

    TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    List<org.apache.solr.handler.component.SearchComponent>
     
    protected List<String>
     
     
    void
    handleRequestBody(org.apache.solr.request.SolrQueryRequest req, org.apache.solr.response.SolrQueryResponse rsp)
     
    void
    inform(org.apache.solr.core.SolrCore core)
    Initialize the components based on name.
    void
    init(org.apache.solr.core.PluginInfo info)
     
    static void
    removeFacetQueriesWithCountZero(org.apache.solr.response.SolrQueryResponse rsp)
     
    final org.apache.solr.common.SolrDocument
    toSolrDocument(org.apache.lucene.document.Document doc, org.apache.solr.schema.IndexSchema schema)
     

    Methods inherited from class org.apache.solr.handler.RequestHandlerBase

    getApis, getCategory, getDocs, getInitArgs, getName, getPluginInfo, getRequestHandler, getSolrParamsFromNamedList, getSource, getStatistics, getSubHandler, getVersion, handleRequest, init, initializeMetrics, setPluginInfo

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.solr.api.ApiSupport

    registerV1, registerV2
  • Field Details

    • components

      protected volatile List<org.apache.solr.handler.component.SearchComponent> components
    • FACET_COUNTS_KEY

      public static final String FACET_COUNTS_KEY
      Facet SOLR Queries are omitting facet results with count equals to 0 as general rule. SOLR Queries executed on a Shard environment, don't include these results but the same query executed on a single server environment are adding these elements to the response. This method removes every facet query having count equals to 0 to provide the same behaviour in both cases. A query like the following, will return only Facet Queries having elements: "facetQueries" : [ { "query" : "content.size:[0 TO 102400]", "label" : "small"}, { "query" : "content.size:[102400 TO 1048576]", "label" : "medium"}, { "query" : "content.size:[1048576 TO 16777216]", "label" : "large"} ] For instance, if there are only results with "small" key, the result will be: "facetQueries": [ { "label": "small", "filterQuery": "content.size:[0 TO 102400]", "count": 5 } ]
      See Also:
    • FACET_CONTEXT_KEY

      public static final String FACET_CONTEXT_KEY
      See Also:
  • Constructor Details

    • AlfrescoSearchHandler

      public AlfrescoSearchHandler()
  • Method Details

    • getDefaultComponents

      protected List<String> getDefaultComponents()
    • init

      public void init(org.apache.solr.core.PluginInfo info)
      Specified by:
      init in interface org.apache.solr.util.plugin.PluginInfoInitialized
    • inform

      public void inform(org.apache.solr.core.SolrCore core)
      Initialize the components based on name. Note, if using INIT_FIRST_COMPONENTS or INIT_LAST_COMPONENTS, then the DebugComponent will always occur last. If this is not desired, then one must explicitly declare all components using the INIT_COMPONENTS syntax.
      Specified by:
      inform in interface org.apache.solr.util.plugin.SolrCoreAware
    • getComponents

      public List<org.apache.solr.handler.component.SearchComponent> getComponents()
    • handleRequestBody

      public void handleRequestBody(org.apache.solr.request.SolrQueryRequest req, org.apache.solr.response.SolrQueryResponse rsp) throws Exception
      Specified by:
      handleRequestBody in class org.apache.solr.handler.RequestHandlerBase
      Throws:
      Exception
    • removeFacetQueriesWithCountZero

      public static void removeFacetQueriesWithCountZero(org.apache.solr.response.SolrQueryResponse rsp)
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface org.apache.solr.core.SolrInfoMBean
      Specified by:
      getDescription in class org.apache.solr.handler.RequestHandlerBase
    • toSolrDocument

      public final org.apache.solr.common.SolrDocument toSolrDocument(org.apache.lucene.document.Document doc, org.apache.solr.schema.IndexSchema schema)