Python 2.7 telah mencapai akhir dukungan
dan akan
dihentikan penggunaannya
pada 31 Januari 2026. Setelah penghentian penggunaan, Anda tidak akan dapat men-deploy aplikasi Python 2.7, meskipun organisasi Anda sebelumnya menggunakan kebijakan organisasi untuk mengaktifkan kembali deployment runtime lama. Aplikasi Python 2.7 yang ada akan terus berjalan dan menerima traffic setelah
tanggal penghentiannya. Sebaiknya Anda
bermigrasi ke versi Python terbaru yang didukung.
Class GetResponse
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Class GetResponse
mewakil hasil metode yang dipanggil untuk menampilkan informasi tentang dokumen dan indeks.
GetResponse
ditentukan dalam modul google.appengine.api.search
.
Pengantar
ObjekGetResponse
ditampilkan dari panggilan ke
index.get_range()
atau
search.get_indexes().
Anda dapat melakukan iterasi pada instance
GetResponse
, yang akan menampilkan anggota
properti hasil. Konten properti
ditentukan oleh jenis panggilan yang membuat instance GetResponse
.
Misalnya, kode berikut menunjukkan cara GetResponse
dapat digunakan untuk menentukan dokumen mana yang berhasil dihapus. Dalam hal ini, iterasi akan menampilkan Documents.
response = index.get_range()
for document in response:
print "document ", document
Konstruktor
Konstruktor untuk class GetResponse
ditentukan sebagai berikut:
-
class GetResponse(hasil=Tidak ada)
Buat instance class GetResponse
.
Argumen
- hasil
Nilai awal properti results
.
Nilai hasil
Instance baru dari class GetResponse
.
Pengecualian
- TypeError
Parameter memiliki jenis yang tidak valid, atau atribut yang tidak diketahui telah diteruskan.
- ValueError
Parameter memiliki nilai yang tidak valid.
Properti
Instance class GetResponse
memiliki properti berikut:
- hasil
Daftar hasil, yang jenisnya bergantung pada panggilan yang menampilkan
objek. Jika menampilkan dari panggilan ke
get_range(),
results
adalah daftar Documents dalam urutan menurun dari ID-nya. Jika menampilkan dari panggilan ke
search.get_indexes(),
results
adalah daftar
Indexes.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-09-01 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-01 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)."]]