Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

*Valid for version Locator 2.9→

Note: be Be sure to use a field that is indexed, the below example requires Lingo/Supervisor. Name must match in all 3 places (bolded). The "name", "suggest.dictionary" and "setting_value" need to be the same value. Person is used in this example. "field" is the name of the indexed Solr field to create suggest on.

  1. Add your new suggester to

    solr.config or override

    solrconfig.xml using solrconfig_override.xml (How do override files work?) like this example:

...

  1. Code Block
    languagexml
    themeEmacs
    titlesolrconfig_overrides.xml
    <add sel="config/searchComponent[@name='real_suggest']">

...

  1. 
        <lst name="suggester">

...

  1. 
          <str name="name"

...

  1. >Person</str>
          <str name="lookupImpl">FuzzyLookupFactory</

...

  1. str>
          <str name="dictionaryImpl">HighFrequencyDictionaryFactory</

...

  1. str>
          <str name="storeDir">suggester_fuzzy_dir_generic</

...

  1. str>
          <str name="field"

...

  1. >lingo_

...

  1. person</str>
          <str name="suggestAnalyzerFieldType">phrase_suggest</

...

  1. str>
          <str name="exactMatchFirst">true</

...

  1. str>
          <str name="buildOnStartup">true</

...

  1. str>
          <str name="buildOnCommit">true</

...

    </lst>
</add>

...

  1. str>
        </lst>
    </add>
    <add sel="/config/requestHandler[@name='/real_suggest']/lst[@name='defaults']">

...

  1. 
        <str name="suggest.dictionary"

...

  1. >Person</str>
    </

...

  1. add>

...


  1. Add the suggester name to index_settings table

...

  1. . The setting is called "SuggestersToGroup" and the value is your suggester name, Postgres insert sql example

...

  1. :

    Code Block
    languagesql
    themeEmacs
    titleInsert SuggestersToGroup to index.index_settings
    INSERT INTO index.index_setting(
                index_id, setting_name, setting_value, creation_date_utc, 
                last_modified_date_utc)
        VALUES ('460f7ec6-8ddd-4654-af5b-8d5b2d72131e

...

  1. ', 'SuggestersToGroup', 'Person', now(), now());

    You can verify that you are using the correct index_id by running List command of Via.IndexAdmin.exeIf you add more than one suggester the setting_value is comma delimited. 

  2. Upload changes to ZooKeeper. From CMD, run: solr zk upconfig -z localhost:9983 -n ViaWorksCloud -d C:\ProgramData\ayfie\Locator\Solr\configsets\ViaWorksCloud\conf
  3. Reload the Solr core by browsing to http://localhost:8983/solr/#/~collections/ViaWorksCloud and clicking "Reload".

Grouped suggestions will now appear in the suggestion box after 3 characters are entered under the group heading with the Name used in the configuration.

How to set up custom Lingo fields: How to add custom Lingo fields to Locator