Configuring additional search components

For example, add spell check.

To configure additional search components, add the search component and define it in the handler.

For example, to add the Java spelling checking package JaSpell:

<searchComponent class="solr.SpellCheckComponent" name="suggest_jaspell">
    <lst name="spellchecker">
      <str name="name">suggest</str>
      <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
      <str name="lookupImpl">org.apache.solr.spelling.suggest.jaspell.JaspellLookup</str>
      <str name="field">suggest</str>
      <str name="storeDir">suggest</str>
      <str name="buildOnCommit">true</str>
      <float name="threshold">0.0</float>
    </lst>
  </searchComponent>

Configure the parameters for the request handler:

<requestHandler class="org.apache.solr.handler.component.SearchHandler" name="/suggest">
    <lst name="defaults">
      <str name="spellcheck">true</str>
      <str name="spellcheck.dictionary">suggest</str>
      <str name="spellcheck.collate">true</str>
      <str name="spellcheck.extendedResults">true</str>
    </lst>
    <arr name="last-components">
      <str>suggest_jaspell</str>
    </arr>
  </requestHandler>

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com