Kentico 8.2 Smart Search Results Sorting and Relevancy Score

Kyle G asked on March 24, 2017 19:10

Hi there,

When I leave the Sort field blank on the Smart Search Results control, the relevance scores work for individual content items. But the second I add in a sort condition (documentmodifiedwhen desc), it breaks the relevancy and everything now appears as 0%.

What I want is the results sorting by documentmodifiedwhen desc by default AND have the relevancy score working. Can I not have both?

Thanks,

Kyle

Correct Answer

Rui Wang answered on March 28, 2017 17:11

I just tried the same thing on a colleague's v8.2.50 site, and it works fine. So something is not right in your instance. Do you have other instances like dev, stage or prod that you can create test page with? Otherwise, hotfix or upgrade may be the last option.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Rui Wang answered on March 27, 2017 16:29

Have you tried: documentcreatedwhen DESC, ##SCORE##

0 votesVote for this answer Mark as a Correct answer

Kyle G answered on March 27, 2017 21:27

Thanks Rui, but that doesn't work either.

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on March 27, 2017 21:41 (last edited on March 27, 2017 21:44)

Sorry Kyle, I miss understood you earlier. You are saying once you add "documentcreatedwhen DESC" into the Search sort property, all the relevance scores became 0, yet the order is correct.

I don't have a v8.2 site any more, the last v8.2 was upgraded to v9. But I cannot reproduce that issue with my v9 and v10 sites, with the date sort, relevance scores are still showing like before.

I haven't see any bug about that. Which version of hotfix are you on?

0 votesVote for this answer Mark as a Correct answer

Kyle G answered on March 28, 2017 14:15

No worries! Yeah, anything added to the Search Sort property breaks the score and sets it to zero. But the order is correct.

I have version 8.2.5467.29685 but could do a hotfix or upgrade to v9 if things aren't too different.

Kyle

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on March 28, 2017 16:09

Can you try a couple more things. One is to use some other data fields in the sort and see if it makes a different. Even try have just "##SCORE##" in there for sort and see if any value in sort will break the display.

Then also take a look into the transformation and see if the method used for relevance score is broke.

0 votesVote for this answer Mark as a Correct answer

Kyle G answered on March 28, 2017 16:21

"##SCORE##" also breaks the score. It only works when nothing is in the sort field. This is the code:

<%# Convert.ToInt32(ValidationHelper.GetDouble(Eval("Score"), 0) * 100) %>%

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on March 28, 2017 16:28

In the transformation for result, can you try display the score directly, like <%# Eval("Score") %> and see if the Score is not return somehow.

Also, try to do a manual rebuild of the index.

0 votesVote for this answer Mark as a Correct answer

Kyle G answered on March 28, 2017 16:35

Displaying the score directly shows the correct value only with an empty sort value. Otherwise it is "NaN". Rebuilding the indexes doesn't help. Thanks for your help with this.

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on March 28, 2017 16:45

Which search result web part are you using? Search result or Search dialog with result. Can you try use the other one and see if the web part could be broken.

0 votesVote for this answer Mark as a Correct answer

Kyle G answered on March 28, 2017 17:00

I'm currently using the "Smart Search Results" web part, but just for fun I tried adding the other one. The score also breaks once a sort is added.

0 votesVote for this answer Mark as a Correct answer

Kyle G answered on March 28, 2017 19:29

Thanks Rui, I applied the first .49 hotfix and it fixed the problem.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.