Close

Sort by Product Tags?

Posted: one year ago Quote #272
Hello

I have a product that has many similarly named products. Under normal circumstances, it does not show in the top 6 results when customers search for it in certain ways. Is it possible to add product tags (or some other mechanism) by which we can sort this product to the top when customers search for it with certain keywords. I hope I have explained myself clearly. If not I will be happy to clarify further.
Posted: one year ago Quote #273
Dear Sir,

You can add ProductIds with search terms in Elevate.xml and display Products according to your requirement.
Changes will be required in Elevate.xml file and SolrConfig.xml.

For guidance you can follow : https://lucene.apache.org/solr/guide/6_6/the-query-elevation-component.html

Regards,
Ankita Rana
Posted: one year ago Quote #274
Is there more detailed information on this? My Solr config file had the specified elevation components as shown below:

  <searchComponent name="elevator" class="solr.QueryElevationComponent" >
    <!-- pick a fieldType to analyze queries -->
    <str name="queryFieldType">string</str>
    <str name="config-file">elevate.xml</str>
  </searchComponent>

  <!-- A request handler for demonstrating the elevator component -->
  <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
    <lst name="defaults">
      <str name="echoParams">explicit</str>
    </lst>
    <arr name="last-components">
      <str>elevator</str>
    </arr>
  </requestHandler>

And I modified the elevate.xml as shown below:

<elevate>

<query text="<searchterm1>">
  <doc id="3187" />
</query>

<query text="<searchterm2>">
  <doc id="3187" />
</query>

<query text="<searchterm3>">
  <doc id="3187" />
</query>

<query text="<searchterm4>">
  <doc id="3187" />
</query>

<query text="<searchterm5>">
  <doc id="3187" />
</query>

<query text="<searchterm6>">
  <doc id="3187" />
</query>

</elevate>

After doing this, I re-indexed the site, restarted Solr and the specified product id is not being shown when I type in the search terms specified. Did I miss a step?
Posted: one year ago Quote #275
Dear Sir,

I am sharing the things required to change in SolrConfig.xml, I have checked your code and found that you have used string instead text in fieldtype. So please replace your code with below and check if that works for you.


  <searchComponent name="elevator" class="solr.QueryElevationComponent" >
    <!-- pick a fieldType to analyze queries -->
    <str name="queryFieldType">text</str>
    <str name="config-file">elevate.xml</str>
  </searchComponent>

  <!-- A request handler for demonstrating the elevator component -->
  <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
    <lst name="defaults">
      <str name="echoParams">explicit</str>
    </lst>
    <arr name="last-components">
      <str>elevator</str>
    </arr>
  </requestHandler>




=> Also in RequestHandller  "/select" add last component as below:

  
        <arr name="last-components">
    <str>elevator</str>
         </arr>


Please check images for better understanding: http://prntscr.com/oicas1

Regards,
Ankita Rana
Posted: one year ago Quote #276
Ankita wrote:
Dear Sir,

I am sharing the things required to change in SolrConfig.xml, I have checked your code and found that you have used string instead text in fieldtype. So please replace your code with below and check if that works for you.


  <searchComponent name="elevator" class="solr.QueryElevationComponent" >
    <!-- pick a fieldType to analyze queries -->
    <str name="queryFieldType">text</str>
    <str name="config-file">elevate.xml</str>
  </searchComponent>

  <!-- A request handler for demonstrating the elevator component -->
  <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
    <lst name="defaults">
      <str name="echoParams">explicit</str>
    </lst>
    <arr name="last-components">
      <str>elevator</str>
    </arr>
  </requestHandler>




=> Also in RequestHandller  "/select" add last component as below:

  
        <arr name="last-components">
    <str>elevator</str>
         </arr>


Please check images for better understanding: http://prntscr.com/oicas1

Regards,
Ankita Rana


I have modified my config files to match this and it mostly works. For example in my elevate XML:

<query text="foo bar">
  <doc id="3187" />
</query>
<query text="searchquery">
  <doc id="3187" />
</query>

When typing "searchquery" the product moves straight to the top as intended. When typing "foo bar", it does not make the list. Any text I tired with a space caused problems. Is there something I can do to avoid issues with spaces, dashes, etc.?
Posted: one year ago Quote #277
Just want to check in to see if what I am asking is possible? Can we take any arbitrary search string with spaces or dashes and map that to a product id in nopCommerce?
Posted: one year ago Quote #278
Dear Sir,

Yes, it is possible.
Simply you need to replace space with "+AND+". Please check the example over here : http://prntscr.com/omvlu3
I have setup on my end as you can see : http://prntscr.com/omvmh4  

Regards,
Ankita Rana