Class 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 java.util.List<org.apache.solr.handler.component.SearchComponent> components  
      static java.lang.String FACET_CONTEXT_KEY  
      static java.lang.String FACET_COUNTS_KEY
      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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<org.apache.solr.handler.component.SearchComponent> getComponents()  
      protected java.util.List<java.lang.String> getDefaultComponents()  
      java.lang.String getDescription()  
      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)  
      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 Detail

      • components

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

        public static final java.lang.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:
        Constant Field Values
      • FACET_CONTEXT_KEY

        public static final java.lang.String FACET_CONTEXT_KEY
        See Also:
        Constant Field Values
    • Constructor Detail

      • AlfrescoSearchHandler

        public AlfrescoSearchHandler()
    • Method Detail

      • getDefaultComponents

        protected java.util.List<java.lang.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 java.util.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 java.lang.Exception
        Specified by:
        handleRequestBody in class org.apache.solr.handler.RequestHandlerBase
        Throws:
        java.lang.Exception
      • removeFacetQueriesWithCountZero

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

        public java.lang.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)