Configure the Suggest Component
-
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.
In this example, create a suggester called mySuggester in solrconfig.xml using the
AnalyzingInfixLookupFactory
. Definedescription
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>
-
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" />
-
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
-
To enable autosuggest in Fusion, add the
suggest
request handler to the allowed request handlers in the Solr Query stage of the query pipeline.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
-
Start searching!
http://localhost:8764/api/query-pipelines/PIPELINE/collections/COLLECTION_NAME/suggest?suggest.q=ca...