Stay organized with collections Save and categorize content based on your preferences.
Class SortExpression
represents a multi-dimensional sort of Documents.
The following code shows how to sort documents based on product rating in descending order and then cheapest product within similarly rated products, sorting at most 1000 documents:
SortOptions(expressions=[ SortExpression(expression='rating', direction=SortExpression.DESCENDING, default_value=0), SortExpression(expression='price + tax', direction=SortExpression.ASCENDING, default_value=999999.99)], limit=1000)
SortOptions
is defined in the google.appengine.api.search
module.
The constructor for class SortOptions
is defined as follows:
Sort documents according to the specified options.
Arguments
An iterable of SortExpression representing a multi-dimensional sort of Documents.
A match scorer specification which may be used to score documents or in a SortExpression combined with other features.
The limit on the number of documents to score. It is advisable to set this limit on large indexes.
Result value
A new instance of class SortOptions
.
Exceptions
If any of the parameters have an invalid type, or an unknown attribute is passed.
If any parameter has an invalid value.
An instance of class SortOptions
has the following properties:
Returns a list of SortExpression specifying a multi-dimensional sort.
Returns a match scorer used to score documents.
Returns the limit on the number of documents to score.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["The `SortOptions` class enables multi-dimensional sorting of documents, leveraging `SortExpression` for detailed control."],["`SortOptions` allows specifying sorting criteria using an iterable of `SortExpression`, a match scorer, and a limit on the number of documents to sort."],["The `SortOptions` constructor can be configured with `expressions`, `match_scorer`, and `limit`, throwing `TypeError` or `ValueError` if input is invalid."],["`SortExpression` objects can define the direction of sorting, such as ascending or descending, and a default value for the sort key."],["`SortOptions` properties `expressions`, `match_scorer`, and `limit` allow you to access the configured settings for sorting."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4