0

My scenario is based on a web portal in .NET C# that use the Amazon CloudSearch to show entertainment's events. Here is my searchURL:

http://search-events-sz5bnsbiljweiirjdddbhagoj4.us-east-1.cloudsearch.amazonaws.com/2011-02-01/search?bq=startdate_unit:20140115..20140121&size=50&start=0&facet=categoryname,countyname,venuename,startdate_unit&return-fields=order%2Cscore%2Ccreateddate%2Cstartdate_unit%2Cstarttime%2Cshortdescription%2Csubtext%2Cvenuename_result%2Cimage&rank=-order,-score&results-type=xml&results-type=xml

How to use the rand() function on my search with rank by -order,-score?

As You can see I have set up my "rank=-order,-score" where "order" is given for recurring events by date or duplicated events with different categories. The "score" is given by my frontend application that give a score for each event by completeness.

As I can have thousands of record with order=1000 and score=100, I would like to give the chance for all records have the chance to be on the TOP of my search randomizing the results from CloudSearch when I have this scenario where 1000 record has order=1000 and score=100 or with same values.

By using the rand() on my rank could solve this problem or what else CloudSearch feature could I use to solve this issue?

1 Answers1

1

For who may concern. I have found how to solve it by configuring a rank expression which consists of the rand() function:

&rank-expression1=rand()

then, I used this expression as a tertiary rank criteria:

rank=-order,-score,expression1