11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The main features of this Suggester are:<br />

Lookup implementation pluggability<br />

Term dictionary pluggability, giving you the flexibility to choose the dictionary implementation<br />

Distributed support<br />

The solrconfig.xml found in <strong>Solr</strong>'s " techproducts" example has the new Suggester implementation<br />

configured already. For more on search components, see the section RequestHandlers and SearchComponents<br />

in <strong>Solr</strong>Config.<br />

Covered in this section:<br />

Configuring Suggester in solrconfig.xml<br />

Adding the Suggest Search Component<br />

Adding the Suggest Request Handler<br />

Example Usages<br />

Get Suggestions with Weights<br />

Multiple Dictionaries<br />

Context Filtering<br />

Configuring Suggester in solrconfig.xml<br />

The " techproducts" example solrconfig.xml has a suggest search component and a /suggest request<br />

handler already configured. You can use that as the basis for your configuration, or create it from scratch, as<br />

detailed below.<br />

Adding the Suggest Search Component<br />

The first step is to add a search component to solrconfig.xml and tell it to use the SuggestComponent. Here<br />

is some sample code that could be used.<br />

<br />

<br />

mySuggester<br />

FuzzyLookupFactory<br />

DocumentDictionaryFactory<br />

cat<br />

price<br />

string<br />

false<br />

<br />

<br />

Suggester Search Component Parameters<br />

The Suggester search component takes several configuration parameters. The choice of the lookup<br />

implementation ( lookupImpl, how terms are found in the suggestion dictionary) and the dictionary<br />

implementation ( dictionaryImpl, how terms are stored in the suggestion dictionary) will dictate some of the<br />

parameters required. Below are the main parameters that can be used no matter what lookup or dictionary<br />

implementation is used. In the following sections additional parameters are provided for each implementation.<br />

Parameter<br />

searchComponent<br />

name<br />

Arbitrary name for the search component.<br />

Description<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

336

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!