Python 2.7은 지원이 종료되었으며 2026년 1월 31일에
지원 중단됩니다. 지원 중단 후에는 조직에서 이전에 조직 정책을 사용하여 레거시 런타임의 배포를 다시 사용 설정한 경우에도 Python 2.7 애플리케이션을 배포할 수 없습니다. 기존 Python 2.7 애플리케이션은
지원 중단 날짜 이후에도 계속 실행되고 트래픽을 수신합니다.
지원되는 최신 Python 버전으로 마이그레이션하는 것이 좋습니다.
GetResponse 클래스
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
GetResponse
클래스는 문서 및 색인에 대한 정보를 반환하도록 호출된 메서드의 결과를 나타냅니다.
GetResponse
은 모듈 google.appengine.api.search
에 정의됩니다.
소개
GetResponse
객체는 index.get_range() 또는 search.get_indexes()에 대한 호출에서 반환됩니다. GetResponse
의 인스턴스를 반복할 수 있습니다. 그러면 results 속성의 구성원이 반환됩니다. 이 속성의 콘텐츠는 GetResponse
인스턴스를 만든 호출 유형에 따라 결정됩니다.
예를 들어 다음 코드는 GetResponse
를 사용하여 성공적으로 삭제된 문서를 확인하는 방법을 보여줍니다. 이 경우, 반복하면 여러 문서가 반환됩니다.
response = index.get_range()
for document in response:
print "document ", document
생성자
GetResponse
클래스의 생성자는 다음과 같이 정의됩니다.
-
class GetResponse(results=None)
GetResponse
클래스의 인스턴스를 생성합니다.
인수
- 결과
results
속성의 초기값입니다.
결과 값
GetResponse
클래스의 새 인스턴스입니다.
예외
- TypeError
매개변수가 잘못된 유형이거나 알 수 없는 속성이 전달되었습니다.
- ValueError
매개변수의 값이 잘못되었습니다.
속성
GetResponse
클래스의 인스턴스에는 다음과 같은 속성이 있습니다.
- 결과
객체를 반환하는 호출에 따라 유형이 달라지는 결과 목록입니다. get_range()에 대한 호출에서 반환되는 경우 results
는 식별자 기준 내림차순으로 나열된 문서의 목록입니다. search.get_indexes()에 대한 호출에서 반환되는 경우 results
는 색인의 목록입니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 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\u003eGetResponse\u003c/code\u003e represents the results obtained from methods that retrieve information about documents and indexes, particularly in the context of first-generation runtimes and potential migration to second-generation runtimes.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eGetResponse\u003c/code\u003e object is returned by \u003ccode\u003eindex.get_range()\u003c/code\u003e or \u003ccode\u003esearch.get_indexes()\u003c/code\u003e, allowing iteration over the \u003ccode\u003eresults\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGetResponse\u003c/code\u003e class can be initialized with a \u003ccode\u003eresults\u003c/code\u003e parameter using the constructor \u003ccode\u003eGetResponse(results=None)\u003c/code\u003e, and it raises \u003ccode\u003eTypeError\u003c/code\u003e or \u003ccode\u003eValueError\u003c/code\u003e for invalid inputs.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eresults\u003c/code\u003e property of a \u003ccode\u003eGetResponse\u003c/code\u003e instance is a list, which either contains \u003ccode\u003eDocuments\u003c/code\u003e when returned from \u003ccode\u003eget_range()\u003c/code\u003e or contains \u003ccode\u003eIndexes\u003c/code\u003e when returned from \u003ccode\u003eget_indexes()\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# The GetResponse Class\n\nClass `GetResponse` represents\nthe results of methods invoked to return information about documents and indexes.\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`GetResponse` is defined in the module `google.appengine.api.search`.\n\nIntroduction\n------------\n\nA `GetResponse` object is returned from a call to either\n[index.get_range()](/appengine/docs/legacy/standard/python/search/indexclass#Index_get_range)\nor\n[search.get_indexes()](/appengine/docs/legacy/standard/python/search/functions#get_indexes).\nYou can iterate over an instance of\n`GetResponse`, which will return the members of its\n[results](#GetResponse_results) property. The contents of the property\nare determined by the type of call that created the instance of `GetResponse`.\n\nFor example, the following code shows how `GetResponse` could be used to\ndetermine which documents were successfully deleted. In this case\nthe iteration returns\n[Documents](/appengine/docs/legacy/standard/python/search/documentclass). \n\n```python\nresponse = index.get_range()\nfor document in response:\n print \"document \", document\n```\n\nConstructor\n-----------\n\nThe constructor for class `GetResponse` is defined as follows:\n\n\nclass GetResponse(results=None)\n\n:\n\n Construct an instance of class `GetResponse`.\n\n \u003cbr /\u003e\n\n:\n\n **Argument**\n\n results\n\n : Initial value of its `results` property.\n\n Result value\n\n : A new instance of class `GetResponse`.\n\n Exceptions\n\n TypeError\n\n : A parameter has an invalid type, or an unknown attribute was passed.\n\n ValueError\n\n : A parameter has an invalid value.\n\n \u003cbr /\u003e\n\nProperties\n----------\n\nAn instance of class `GetResponse` has the following property:\n\nresults\n\n: A list of results, whose type depends on the call that returns the\n object. If returning from a call to\n [get_range()](/appengine/docs/legacy/standard/python/search/indexclass#Index_get_range),\n `results` is a list of [Documents](/appengine/docs/legacy/standard/python/search/documentclass)\n in descending order of their identifiers. If returning from a call to\n [search.get_indexes()](/appengine/docs/legacy/standard/python/search/functions#get_indexes),\n `results` is a list of\n [Indexes](/appengine/docs/legacy/standard/python/search/indexclass)."]]