1

弊社のウェブサイトで solr を検索エンジンとして使用しようとしていますが、販売数で提案を並べ替えることができないという問題があります。

コンポーネントの Facet、Terms、FreeTextLookupFactory、および spellcheck コンポーネントを試しましたが、上記のコンポーネントのいずれも希望する結果を得ることができません。

私が理解している最も重要なことは、私たちが選択した重みの提案を並べ替えることができるかどうかです.

使用しているsolrのバージョンは5.0です。

schema.xml:

<field name="name_complete" type="text_shingle" indexed="true" stored="true" required="false" multiValued="false" omitTermFreqAndPositions="true"/>

<fieldType name="text_shingle" class="solr.TextField" positionIncrementGap="100"> 
    <analyzer> 
        <tokenizer class="solr.StandardTokenizerFactory"/> 
        <filter class="solr.LowerCaseFilterFactory"/> 
        <filter class="solr.ShingleFilterFactory" maxShingleSize="4" outputUnigrams="true"/> 
    </analyzer> 
</fieldType>

solrconfig.xml FreeTextLookupFactory:

<searchComponent name="suggest" class="solr.SuggestComponent">
    <lst name="suggester">
        <str name="name">suggest_product_free</str>
        <str name="lookupImpl">FreeTextLookupFactory</str>
        <str name="dictionaryImpl">DocumentDictionaryFactory</str>
        <str name="field">name_complete</str>
        <str name="indexPath">suggest_product_free</str>
        <str name="weightField">n_sales</str>
        <str name="buildOnCommit">true</str>

        <str name="suggestFreeTextAnalyzerFieldType">text_shingle</str>
    <int name="ngrams">3</int>
    </lst>
</searchComponent>

<requestHandler name="/suggest" class="solr.SearchHandler">
    <lst name="defaults">
        <str name="echoParams">explicit</str>
        <str name="wt">json</str>
        <str name="indent">true</str>
        <str name="suggest">true</str>
        <str name="suggest.count">10</str>
    </lst>

    <arr name="components">
        <str>suggest</str>
    </arr>
</requestHandler>

スペルチェック:

<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
    <lst name="spellchecker">
        <str name="queryAnalyzerFieldType">text_shingle</str>
        <str name="name">autocomplete</str>
        <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
        <str name="lookupImpl">org.apache.solr.spelling.suggest.fst.WFSTLookupFactory</str>
        <str name="field">name_complete</str>
        <str name="buildOnCommit">true</str>
        <float name="threshold">0.005</float>
       <str name="spellcheckIndexDir">./suggester_autocomplete</str>
    </lst>
</searchComponent>

<requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
    <lst name="defaults">
      <!-- Solr will use suggestions from both the 'default' spellchecker
           and from the 'wordbreak' spellchecker and combine them.
           collations (re-written queries) can include a combination of
           corrections from both spellcheckers -->
        <str name="spellcheck">true</str>
        <str name="spellcheck.count">10</str>
        <str name="spellcheck.onlyMorePopular">true</str>
        <str name="spellcheck.dictionary">autocomplete</str>
        <!--str name="spellcheck.dictionary">wordbreak</str>
        <str name="spellcheck.extendedResults">true</str>
        <str name="spellcheck.alternativeTermCount">5</str>
        <str name="spellcheck.maxResultsForSuggest">5</str>
        <str name="spellcheck.collate">true</str>
        <str name="spellcheck.collateExtendedResults">true</str>
        <str name="spellcheck.maxCollationTries">10</str>
        <str name="spellcheck.maxCollations">5</str-->
    </lst>
    <arr name="last-components">
      <str>spellcheck</str>
    </arr>
  </requestHandler>

重量の提案を注文する方法はありますか?

すべてに感謝し、良い一日を。

例: solr に次の値が保存されているとします。

1: Reflex canon eos 7d (weight: 1)
2: Reflex canon eos 6d (weight: 2)
3: Reflex canon eos 70d (weight: 3)

文字列「can」を要求しました。私が望む結果:

canon eos
canon eos 70d
canon eos 6d
canon eos 7d

実際には、重量を注文できるのはオートコンプリートでした。

4

0 に答える 0