Python 2.7은 지원이 종료되었으며 2026년 1월 31일에
지원 중단됩니다. 지원 중단 후에는 조직에서 이전에 조직 정책을 사용하여 레거시 런타임의 배포를 다시 사용 설정한 경우에도 Python 2.7 애플리케이션을 배포할 수 없습니다. 기존 Python 2.7 애플리케이션은
지원 중단 날짜 이후에도 계속 실행되고 트래픽을 수신합니다.
지원되는 최신 Python 버전으로 마이그레이션하는 것이 좋습니다.
SearchResults 클래스
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
SearchResults
클래스는 Index.search()
를 사용하여 검색 요청 실행 결과를 제공합니다.
SearchResults
은 google.appengine.api.search
모듈에 정의됩니다.
생성자
SearchResults
클래스의 생성자는 다음과 같이 정의됩니다.
-
class SearchResults(number_found, results=None, cursor=None)
해당 쿼리의 매개변수를 지정하여 검색 서비스가 색인을 쿼리하도록 요청합니다.
인수
- number_found
쿼리로 찾은 문서 수입니다.
- 결과
검색 요청을 실행하여 반환된 ScoredDocument 객체 목록입니다.
- cursor
현재 검색 결과의 끝에서 계속 검색을 수행할 수 있게 해주는 Cursor 객체입니다.
결과 값
Index.search() 실행 결과를 나타내는 SearchRequest
클래스의 새 인스턴스입니다.
예외
- TypeError
매개변수에 잘못된 유형이 있거나 알 수 없는 속성이 전달된 경우 발생합니다.
- ValueError
매개변수에 잘못된 값이 있는 경우 발생합니다.
속성
SearchResults
클래스의 인스턴스에는 다음 속성이 있습니다.
- 결과
쿼리와 일치하는 ScoredDocument 객체 목록을 반환합니다.
- number_found
쿼리와 일치하는 대략적인 문서 개수를 반환합니다. QueryOptions
는 검색 결과의 후처리를 정의합니다. QueryOptions.number_found_accuracy
매개변수가 100으로 설정된 경우 100보다 작거나 같은 number_found
가 정확합니다.
- cursor
- 이 필드를 채우려면 검색의 QueryOptions에 커서를 전달해야 합니다. 그렇지 않으면 None이 됩니다. 마지막 결과에서 검색을 계속하기 위해 사용할 수 있는 결과 Cursor를 반환합니다. 현재 결과 이후 추가 결과가 없으면 None이 반환됩니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-09-04(UTC)
[[["이해하기 쉬움","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\u003e\u003ccode\u003eSearchResults\u003c/code\u003e represents the outcome of a search request made using \u003ccode\u003eIndex.search()\u003c/code\u003e and is found within the \u003ccode\u003egoogle.appengine.api.search\u003c/code\u003e module.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSearchResults\u003c/code\u003e constructor takes parameters such as \u003ccode\u003enumber_found\u003c/code\u003e, \u003ccode\u003eresults\u003c/code\u003e (a list of \u003ccode\u003eScoredDocument\u003c/code\u003e objects), and \u003ccode\u003ecursor\u003c/code\u003e to manage search results and pagination.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eresults\u003c/code\u003e property of \u003ccode\u003eSearchResults\u003c/code\u003e provides a list of \u003ccode\u003eScoredDocument\u003c/code\u003e objects that match the search query.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003enumber_found\u003c/code\u003e property offers an approximate count of documents that match the query, with accuracy influenced by the \u003ccode\u003eQueryOptions.number_found_accuracy\u003c/code\u003e parameter.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecursor\u003c/code\u003e property can be used to continue a search from where the last result left off if a cursor is included in the search's \u003ccode\u003eQueryOptions\u003c/code\u003e, otherwise it will be None.\u003c/p\u003e\n"]]],[],null,["# The SearchResults Class\n\nClass `SearchResults` represents the result of executing a search request using [Index.search()](/appengine/docs/legacy/standard/python/search/indexclass).\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\n`SearchResults` is defined in the `google.appengine.api.search` module.\n\nConstructor\n-----------\n\nThe constructor for class `SearchResults` is defined as follows:\n\n\nclass SearchResults(number_found, results=None, cursor=None)\n\n:\n\n Request the search service to query an index, specifying parameters for that query..\n\n \u003cbr /\u003e\n\n:\n\n Arguments\n\n number_found\n\n : The number of documents found for the query.\n\n results\n\n : The list of [ScoredDocument](/appengine/docs/legacy/standard/python/search/scoreddocumentclass) objects returned from executing a search request.\n\n cursor\n\n : A [Cursor](/appengine/docs/legacy/standard/python/search/cursorclass) object allowing you to continue the search from the end of the current search results.\n\n Result value\n\n : A new instance of class `SearchRequest` representing the results of executing [Index.search()](/appengine/docs/legacy/standard/python/search/indexclass).\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 `SearchResults` has the following properties:\n\nresults\n\n: Returns the list of [ScoredDocument](/appengine/docs/legacy/standard/python/search/scoreddocumentclass) objects matching the query.\n\nnumber_found\n\n: Returns an approximate number of documents matching the query. [QueryOptions](/appengine/docs/legacy/standard/python/search/queryoptionsclass) defining post-processing of the search results. If the `QueryOptions.number_found_accuracy` parameter were set to 100, then `number_found` \\\u003c= 100 is accurate.\n\ncursor\n: For this field to be populated, you must pass a cursor in the search's [QueryOptions](/appengine/docs/legacy/standard/python/search/queryoptionsclass),\n otherwise this will be None. Returns a results [Cursor](/appengine/docs/legacy/standard/python/search/cursorclass) that can be used to continue the search from the last result. If\n there are no more results after the current result, returns None."]]