You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "Buckler, Christine" <Ch...@nordstrom.com> on 2018/08/03 23:26:24 UTC

Solr Suggest Component with weight expression returns no suggestions

I am having difficulty getting Solr's Suggest Component to work with a weight expression. I have tried to match the format of the example in the documentation (see related code from schema.xml and solrconfig.xml below) but no results are found when I request suggestions from this dictionary and there are no logging errors or exceptions. Am I missing something or do I have an incorrect parameter?
schema:
<field name="weight_one" type="pint" indexed="true" stored="true"/>
<field name="weight_two" type="pint" indexed="true" stored="true"/>
solrconfig:
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
  <str name="name">SuggesterX</str>
  <str name="dictionaryImpl">DocumentExpressionDictionaryFactory</str>
  <str name="lookupImpl">FuzzyLookupFactory</str>
  <str name="field">product_name</str>
  <str name="weightExpression">(weight_one + weight_two)</str>
  <str name="sortField">weight_one</str>
  <str name="sortField">weight_two</str>
  <str name="suggestAnalyzerFieldType">text_suggest</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
  <lst name="defaults">
    <str name="suggest">true</str>
    <str name="suggest.count">5</str>
    <str name="suggest.dictionary">SuggesterX</str>
    <!-- <str name="spellcheck.onlyMorePopular">true</str> -->
  </lst>
  <arr name="components">
    <str>suggest</str>
  </arr>
</requestHandler>


Christine