Issues with sorting Smart Search Results

Kyle G asked on April 1, 2015 15:50

I just upgraded to 8.2. I have a SmartSearchResults repeater that was sorted by the DocumentLastPublished field. After the upgrade from 8.1 to 8.2, I can no longer sort by this field. It also breaks my relevance score, which doesn't make sense.

On a related note, before the upgrade I could sort by any field such as Score, DocumentCreatedWhen, etc., EXCEPT DocumentModifiedWhen. This makes no sense to me. I really wanted the sort to be on this field but I settled for DocumentLastPublished because it'll essentially do the same thing. Well, now neither works, so I'm a little stuck.

Any help would be appreciated.

Recent Answers


Juraj Ondrus answered on April 1, 2015 17:06

Hi Kyle,

I believe you have rebuild the index already - if so, could you please check in Modules -> E-commerce -> Classes -> SKU -> Search section that given fields are marked as searchable?

1 votesVote for this answer Mark as a Correct answer

Kyle G answered on April 1, 2015 17:32 (last edited on April 1, 2015 17:33)

Hi Juraj, I didn't even know this was that customizable. It turns out DocumentModifiedWhen wasn't checked as Searchable. I'm now able to sort by that field, which is great.

I have another issue that seems to be related however. Having a sort value on the Smart Search Results breaks the relevance score (<%# Eval("score") %>). It returns NaN. This worked fine before the 8.2 upgrade.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on April 7, 2015 12:51

Hi Kyle,

Have you tried using the Luke tool? It is strange issue. I would use the tool to check the index files to see what exactly is indexed there and whether they have any score assigned. Also, I would try using capital S in the word Score - maybe it was made case sensitive.

0 votesVote for this answer Mark as a Correct answer

Kyle G answered on March 24, 2017 19:08

Back at this again, and now I'm noticing something interesting..

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

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on March 27, 2017 10:13

Have you tried adding also the ##SCORE## macro into the sort field and sort the results on the score and the date?

0 votesVote for this answer Mark as a Correct answer

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