snakile
snakile

Reputation: 54541

Configure Solr's select search handler to use a custom search component

I've written a custom Solr search component and added its JAR file to Solr. I would like to add the component to the list of components to be executed when the select search handler is being used. I looked at the <requestHandler name="/select" ...> entry in the solrconfig.xml file, and noticed that the list of components is empty: There was no components entry under the select requestHandler entry. But the list of components can't be empty because there are components being executed when the select search handler is being used: facet, debug, mlt, highlighting and maybe more. I guess these components are in the component list by default without being specified explicitly in the configuration. How do I add my custom component to the list without ruining it? What do I have to put in the configuration file and where?

Upvotes: 2

Views: 1708

Answers (1)

Jayendra
Jayendra

Reputation: 52799

These Components are enabled by default check SearchComponent

Instead of adding it to the defaults you can easily add it to the request handler

<requestHandler name="/select" class="solr.SearchHandler">
    <!-- add my elevator component to the end of the default list -->
    <arr name="last-components">
      <str>custom-component</str>
    </arr>
</requestHandler>

Define the Search Component in your solrconfig.xml and you can use it then refer presentation

Upvotes: 1

Related Questions