Prior to the configuration and use of the Keyword Suggester you need to set up the following components:
The Keyword Suggester consists of two search components you need to register in your request handler configuration in the
You can register the components for any request handler (e.g. add them to your
/select handler), but we recommend to set up a dedicated request handler for the Keyword Suggester to avoid conflicts with other query time parameters the Keyword Suggester manipulates during processing.
In the following example the Keyword Suggester components are added as search components and named after their corresponding classes
<searchComponent name="keywordSuggesterPre" class="de.pixolution.solr.handler.component.KeywordSuggesterPre" > <str name="pixolution.parser">pixolutionParser</str> <str name="ksuggest.field">keywords</str> <str name="ksuggest.analyzer">keywordsAnalyzer</str> <str name="ksuggest.max">20</str> <str name="ksuggest.threshold">0.2</str> <str name="ksuggest.inspect">50</str> </searchComponent> <searchComponent name="keywordSuggesterPost" class="de.pixolution.solr.handler.component.KeywordSuggesterPost" > </searchComponent>
PixolutionParser is needed for parsing queries.
To retrieve the appropriate parser the name of the
PixolutionParserPlugin is required (see PixolutionParserPlugin for the configuration of the parser name).
All other params can be defined at query time.
Please read on for the allowed values and details about the
If needed, you can simply override all parameters at query time with different values.
This way you can define default values in the
solrconfig.xml that you can override at query time.
See this example how to register a dedicated request handler
/ksuggest with the necessary components
<requestHandler name="/ksuggest" class="solr.SearchHandler"> [...] <arr name="first-components"> <str>keywordSuggesterPre</str> <str>pixolutionComponent</str> </arr> <arr name="last-components"> <str>keywordSuggesterPost</str> </arr> </requestHandler>
The Keyword Suggester will force a certain order in which the components are executed.
The execution order of the components is defined by the
last-components array and needs to be set as shown in the example above.
It is important that the
keywordSuggesterPre.component is set before the
pixolutionComponent within the
keywordSuggesterPost needs to be called within the
External image URL cache
To speed up loading external image URLs you can configure a cache described in External image caching