Product Selector

Fusion 5.12
    Fusion 5.12

    Configure the Suggest Component

    1. Choose a suggester implementation from the Solr Suggester documentation, and define it in the solrconfig.xml file.

      You can edit the solrconfig.xml file inside of the Fusion Admin UI. Navigate to System > Solr Config, and select the solrconfig.xml file to begin.

      Solr Config edit in Fusion Admin UI

      In this example, create a suggester called mySuggester in solrconfig.xml using the AnalyzingInfixLookupFactory. Define description as the suggester’s target field:

      <searchComponent name="suggest" class="solr.SuggestComponent">
        <lst name="suggester">
          <str name="name">mySuggester</str>
          <str name="lookupImpl">AnalyzingInfixLookupFactory</str>
          <str name="dictionaryImpl">DocumentDictionaryFactory</str>
          <str name="field">description</str>
          <str name="suggestAnalyzerFieldType">string</str>
          <str name="buildOnStartup">false</str>
        </lst>
      </searchComponent>
    2. Ensure that the field used for autosuggest is correctly defined in the schema:

      <field name="description" type="text_general" stored="true" indexed="true" multivalued="false" />
    3. Once modified, upload the custom configuration files to ZooKeeper using ZooKeeper’s command line interface.

      Use the zkcli command putfile to replace an existing ZooKeeper configuration file. Typically, CONFIG_NAME will likely represent the name of the collection. Alternatively, the name represents a custom configuration.

      https://FUSION_HOST:FUSION_PORT/apps/solr-dist/server/scripts/cloud-scripts/zkcli.sh -z localhost:2181 -cmd putfile /configs/CONFIG_NAME/solrconfig.xml /Desktop/solrconfig.xml
    4. To enable autosuggest in Fusion, add the suggest request handler to the allowed request handlers in the Solr Query stage of the query pipeline.

      Solr Query stage request handlers

      Build the suggester should using …​/suggest?suggest.build=true. For example:

      http://localhost:8764/api/query-pipelines/PIPELINE/collections/COLLECTION_NAME/suggest?suggest.build=true
    5. Start searching!

      http://localhost:8764/api/query-pipelines/PIPELINE/collections/COLLECTION_NAME/suggest?suggest.q=ca...