Python 2.7 has reached end of support
and will be
deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Python 2.7
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Python
2.7 applications will continue to run and receive traffic after their
deprecation date. We recommend that
you
migrate to the latest supported version of Python.
The GetResponse Class
Stay organized with collections
Save and categorize content based on your preferences.
Class GetResponse
represents
the results of methods invoked to return information about documents and indexes.
GetResponse
is defined in the module google.appengine.api.search
.
Introduction
A GetResponse
object is returned from a call to either
index.get_range()
or
search.get_indexes().
You can iterate over an instance of
GetResponse
, which will return the members of its
results property. The contents of the property
are determined by the type of call that created the instance of GetResponse
.
For example, the following code shows how GetResponse
could be used to
determine which documents were successfully deleted. In this case
the iteration returns
Documents.
response = index.get_range()
for document in response:
print "document ", document
Constructor
The constructor for class GetResponse
is defined as follows:
-
class GetResponse(results=None)
Construct an instance of class GetResponse
.
Argument
- results
Initial value of its results
property.
Result value
A new instance of class GetResponse
.
Exceptions
- TypeError
A parameter has an invalid type, or an unknown attribute was passed.
- ValueError
A parameter has an invalid value.
Properties
An instance of class GetResponse
has the following property:
- results
A list of results, whose type depends on the call that returns the
object. If returning from a call to
get_range(),
results
is a list of Documents
in descending order of their identifiers. If returning from a call to
search.get_indexes(),
results
is a list of
Indexes.
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-25 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-25 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)."]]