RequestHandlerBase 实现接口SolrRequestHandler
SearchHandler:
它的所有逻辑来自 搜索组件SearchComponents. handler配置中,如果没有显示声明组件元素的话,它会使用默认的组件:
-
"query" (usually QueryComponent)
-
"facet" (usually FacetComponent)
-
"mlt" (usually MoreLikeThisComponent)
-
"highlight" (usually HighlightComponent)
-
"stats" (usually StatsComponent)
-
"debug" (usually DebugComponent)
自定义组件:
可以通过配置handler的components元素来实现:
<arr name="components">
<str>query</str>
<str>facet</str>
<str>mlt</str>
<str>highlight</str>
<str>debug</str>
<str>someothercomponent</str>
</arr>
<arr name="first-components">
<str>mycomponent</str>
</arr>
<arr name="last-components">
<str>myothercomponent</str>
</arr>
除默认组件外,上面用到的组件都应该在solrconfig.xml中进行配置。