Developer forum

Forum » Ecommerce - Standard features » Score amount on product search

Score amount on product search

Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi,

 

Is there any way to see what the score is on the product catalog?

 

We have a customer that wants products that have the searched term in the name to rank higher, and even after setting a boost to 100, I am not getting the expected result.

  • I have a NameRank field set to 100
  • I have a summary field with a bunch of fields in it with no boost amout set

 

https://www.screencast.com/t/2SClyV20yb4x

 

What can I be doing wrong?

 

BR,

Nuno Aguiar


Replies

 
Nicolai Pedersen
Reply

Hi Nuno

You can publish the query/search with the querypublisher to see the score.

You have to remember that "Contains" operator does not give any scores at all. Nothing. Only Equals operator will score the result. You might want to read this: https://lucene.apache.org/core/3_5_0/scoring.html

So to get scoring to work, setup your search like in the dumps. Set boost on the "Free text name" field only.

It works by searching the same thing twice. One with CONTAINS operator: field like "search*" that will never give a score and one with EQUALS operator: field = "search" that will give a score if the term is found in full. You can never get a score out of searching for 123 looking for 1234 - that is not possible.

Also setting the "Free text name" field as analyzed or not will have an impact. Consider a situation where product numbers have a seperator. i.e. abc-123. Analyzing that string will give you 2 terms, resulting in a search for 123 will score this document high. If you do NOT analyze, there will be no score. Not untill a search for abc-123 is conducted.

  • Free text (Name, Number, descriptions, etc) analyzed => search field using CONTAINS
  • Free text (Name, Number) analyzed = boost 5 => search field using EQUALS
  • Product name, NOT analyzed = boost 10 => search field using EQUALS
  • Product number, NOT analyzed = boost 20 => search field using EQUALS

BR Nicolai

Capture.PNG Capture1.PNG
 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

I got to see the score. and matches up to what you said about not scoring anything.

 

I read the documentation you provided (and some other related documents) and spent a good deal of time wrapping my head around this and was even writting back to you asking about "Match Any" and "Match All" operators, as they are eligeble for the Boolean Model or the Vector Space Model. Then I realized it could have been because of a custom field type. Once I swithced back to using the standard "System.String" as a Type, it worked.

 

And I agree scoring should not work with "Contains" operator. That was never the case.

 

Best Regards,

Nuno Aguiar

 

You must be logged in to post in the forum