Now we are comfortable with querying the data, it is time to put it in some desirable order. That is, sorting the results. How do we do that? Our old friend
search.QueryOptions takes a keyword argument called
sort_options. We just have to supply that and we are done. Okay, so the question is what this
sort_options argument would be?
It's actually an instance of
search.SortOptions class which takes a single argument called
expressions. What is expressions then? It is just a list of
search.SortExpression instances where
search.SortExpression constructor takes some keyword arguments which define the sorting behavior.
All this seems bit complicated so let's take another look.