1

How can I edit priority search as field in Magento 2? I want search like below:

  1. SKU
  2. Product name
  3. Category
  4. Attribute

But I don't where can I edit it? Any help would be appreciated.

0

Define priority in solrconfig.xml of your collection.

<requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
    <lst name="defaults">
        <str name="df">name_s</str>
        <!-- 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.dictionary">default</str>
        <str name="spellcheck.dictionary">wordbreak</str>
        <str name="spellcheck">on</str>
        <str name="spellcheck.extendedResults">true</str>
        <str name="spellcheck.count">10</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>
        <str name="fl">name,price,description,colors,image</str>
        <str name="qf">name_suggest^30 name_suggest_ngram^50.0 colors_suggest^15 colors_suggest_ngram^25.0</str>
        <str name="pf">name_suggest_edge^50.0 colors_suggest_edge^25.0</str>
        <str name="group">true</str>
        <str name="group.field">name_s</str>
    </lst>
    <arr name="last-components">
        <str>spellcheck</str>
    </arr>
</requestHandler>

The above is for spell check but you can get an idea from it.

<str name="fl">name,price,description,colors,image</str>
<str name="qf">name_suggest^30 name_suggest_ngram^50.0 colors_suggest^15 colors_suggest_ngram^25.0</str>
<str name="pf">name_suggest_edge^50.0 colors_suggest_edge^25.0</str>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.