A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/appengine/docs/legacy/standard/python/search/sortoptionsclass below:

The SortOptions Class | App Engine standard environment for Python 2

The SortOptions Class

Stay organized with collections Save and categorize content based on your preferences.

Class SortExpression represents a multi-dimensional sort of Documents.

This API is supported for first-generation runtimes and can be used when upgrading to corresponding second-generation runtimes. If you are updating to the App Engine Python 3 runtime, refer to the migration guide to learn about your migration options for legacy bundled services.

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.

Constructor

The constructor for class SortOptions is defined as follows:

class SortOptions(expressions=None, match_scorer=None, limit=1000)

Sort documents according to the specified options.

Arguments

expressions

An iterable of SortExpression representing a multi-dimensional sort of Documents.

match_scorer

A match scorer specification which may be used to score documents or in a SortExpression combined with other features.

limit

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

TypeError

If any of the parameters have an invalid type, or an unknown attribute is passed.

ValueError

If any parameter has an invalid value.

Properties

An instance of class SortOptions has the following properties:

expressions

Returns a list of SortExpression specifying a multi-dimensional sort.

match_scorer

Returns a match scorer used to score documents.

limit

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