I'm using Amazon's AWS CloudSearch service, and I'm trying to figure out the sort function. I know how to sort by _score, text fields alphabetically, and a combination of _score and int fields, but I want to sort by _score and a text field.
I have an index on title
of type text
. Here is some sample data:
Win the War A War is Coming Just a Battle War of the Wars Come to the War
If I do a search for war
, I want the following results (simplified score).
How do I sort by (_score desc, title asc)
- score descending followed by title ascending for the results with the same score?
Score | Title ------+------------------- 2 | War of the Wars 1 | A War is Coming 1 | Come to the War 1 | Win the War
I'm using the Java AWS SDK, so hopefully it's doable with that.