Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-11844

Sort suggestions in solr based on the position of keyword

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Suggester

    Description

      I am using Suggest component in solr 6.5 version. I have configured BlendidInfixLookupFactory to sort suggestions based on the search keyword.

      Below is my current configuration:

      <searchComponent name="suggest" class="solr.SuggestComponent">
      <lst name="suggester">
      <str name="name">mySuggester</str>
      <str name="lookupImpl">BlendedInfixLookupFactory</str>
      <str name="dictionaryImpl">DocumentDictionaryFactory</str>
      <str name="field">title</str>
      <str name="suggestAnalyzerFieldType">text_general</str>
      <str name="blenderType">position_linear</str>
      <str name="numFactor">20</str>
      </lst>
      </searchComponent>

      <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
      <lst name="defaults">
      <str name="suggest">true</str>
      <str name="suggest.count">10</str>
      </lst>
      <arr name="components">
      <str>suggest</str>
      </arr>
      </requestHandler>

      But it is not sorting based on the position of keyword and it is returning in random order and not sure what order is being followed. As per solr documentation, it should sort based on the position, but it is not working in that order.

      For Example: My search keyword is blue,
      My Expected results: blue, blue whale, blue water, sky blue
      Actual results: sky blue, blue whale, blue water, blue

      Attachments

        Activity

          People

            Unassigned Unassigned
            Pavithrad Pavithra Dhakshinamurthy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: