lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dboychuck <>
Subject Solr Suggest and weightField
Date Thu, 15 Oct 2015 23:05:02 GMT
I am trying to figure out how to give weights to my suggestions but I can
find no documentation on how to do this correctly.

Here is my configuration:

<searchComponent name="suggest" class="solr.SuggestComponent">
    <lst name="suggester">
      <str name="name">mySuggester</str>
      <str name="dictionaryImpl">DocumentDictionaryFactory</str>
      <str name="lookupImpl">FuzzyLookupFactory</str>
      <str name="field">suggest</str>
      <str name="weightField">popularity</str>
      <str name="suggestAnalyzerFieldType">textSuggest</str>
      <str name="buildOnStartup">false</str>
      <str name="exactMatchFirst">true</str>

The popularity field and weightField are defined in my schema
<field name="popularity" type="float" indexed="true" stored="true"
<field name="weightField" type="float" indexed="true" stored="true"/>

In my suggest field I copy several other fields to be used for suggestions:
<field name="suggest" type="textSuggest" indexed="false" stored="true"

<copyField source="productid" dest="suggest"/>
  <copyField source="manufacturer" dest="suggest"/>
  <copyField source="application" dest="suggest"/>
  <copyField source="type" dest="suggest"/>
  <copyField source="handletype" dest="suggest"/>
  <copyField source="uniqueFinish" dest="suggest"/>

However whenever I perform a search I get 0 for the weights even though
popularity values exist for the documents.


<result name="response" numFound="0" start="0"/>
<lst name="suggest">
<lst name="mySuggester">
<lst name="koh">
<int name="numFound">1</int>
<arr name="suggestions">
<str name="term">kohler</str>
<long name="weight">0</long>
<str name="payload"/>

Can someone please explain to me how to use weightField and payload so that
I can give some ranking to my suggested terms.

View this message in context:
Sent from the Solr - User mailing list archive at

View raw message