Python 2.7은 지원이 종료되었으며 2026년 1월 31일에 지원 중단됩니다. 지원 중단 후에는 조직에서 이전에 조직 정책을 사용하여 레거시 런타임의 배포를 다시 사용 설정한 경우에도 Python 2.7 애플리케이션을 배포할 수 없습니다. 기존 Python 2.7 애플리케이션은 지원 중단 날짜 이후에도 계속 실행되고 트래픽을 수신합니다. 지원되는 최신 Python 버전으로 마이그레이션하는 것이 좋습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eThe \u003ccode\u003eSortOptions\u003c/code\u003e class enables multi-dimensional sorting of documents, leveraging \u003ccode\u003eSortExpression\u003c/code\u003e for detailed control.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSortOptions\u003c/code\u003e allows specifying sorting criteria using an iterable of \u003ccode\u003eSortExpression\u003c/code\u003e, a match scorer, and a limit on the number of documents to sort.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSortOptions\u003c/code\u003e constructor can be configured with \u003ccode\u003eexpressions\u003c/code\u003e, \u003ccode\u003ematch_scorer\u003c/code\u003e, and \u003ccode\u003elimit\u003c/code\u003e, throwing \u003ccode\u003eTypeError\u003c/code\u003e or \u003ccode\u003eValueError\u003c/code\u003e if input is invalid.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSortExpression\u003c/code\u003e objects can define the direction of sorting, such as ascending or descending, and a default value for the sort key.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSortOptions\u003c/code\u003e properties \u003ccode\u003eexpressions\u003c/code\u003e, \u003ccode\u003ematch_scorer\u003c/code\u003e, and \u003ccode\u003elimit\u003c/code\u003e allow you to access the configured settings for sorting.\u003c/p\u003e\n"]]],[],null,["# The SortOptions Class\n\nClass `SortExpression` represents a multi-dimensional sort of Documents.\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| python3\n|\n| /services/access). If you are updating to the App Engine Python 3 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/python-differences) to learn about your migration options for legacy bundled services.\n\nThe following code shows how to sort documents based on product rating\nin descending order and then cheapest product within similarly rated\nproducts, sorting at most 1000 documents: \n\n```python\n SortOptions(expressions=[\n SortExpression(expression='rating',\n direction=SortExpression.DESCENDING, default_value=0),\n SortExpression(expression='price + tax',\n direction=SortExpression.ASCENDING, default_value=999999.99)],\n limit=1000)\n```\n\n`SortOptions` is defined in the `google.appengine.api.search` module.\n\nConstructor\n-----------\n\nThe constructor for class `SortOptions` is defined as follows:\n\n\nclass SortOptions(expressions=None, match_scorer=None, limit=1000)\n\n:\n Sort documents according to the specified options.\n\n:\n\n Arguments\n\n expressions\n\n : An iterable of SortExpression representing a multi-dimensional sort of Documents.\n\n match_scorer\n\n : A match scorer specification which may be used to score documents or in a SortExpression combined with other features.\n\n limit\n\n : The limit on the number of documents to score. It is advisable to set this limit on large indexes.\n\n Result value\n\n : A new instance of class `SortOptions`.\n\n Exceptions\n\n TypeError\n\n : If any of the parameters have an invalid type, or an unknown attribute is passed.\n\n ValueError\n\n : If any parameter has an invalid value.\n\n \u003cbr /\u003e\n\nProperties\n----------\n\nAn instance of class `SortOptions` has the following properties:\n\nexpressions\n\n: Returns a list of SortExpression specifying a multi-dimensional sort.\n\nmatch_scorer\n\n: Returns a match scorer used to score documents.\n\nlimit\n\n: Returns the limit on the number of documents to score."]]