Method: indexing.datasources.items.poll
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इंडेक्स करने की सूची में से, ऐसे आइटम चुनता है जिन्हें बुक नहीं किया गया है. साथ ही, किसी सेट को बुक के तौर पर मार्क करता है. यह सेट, सबसे ज़्यादा प्राथमिकता वाले ItemStatus
आइटम से शुरू होता है, जिनका टाइमस्टैंप सबसे पुराना होता है. प्राथमिकता का क्रम इस तरह से है:
ERROR
MODIFIED
NEW_ITEM
ACCEPTED
आइटम रिज़र्व करने से यह पक्का होता है कि अन्य थ्रेड से पोलिंग करने पर, ओवरलैप होने वाले सेट न बनें.
रिज़र्व किए गए आइटम मैनेज करने के बाद, क्लाइंट को आइटम को फिर से रिज़र्व नहीं किए गए आइटम की स्थिति में डालना चाहिए. इसके लिए, index,
को कॉल करें या push
को टाइप REQUEUE.
के साथ कॉल करें
चार घंटे बाद, आइटम अपने-आप उपलब्ध हो जाते हैं (बुक नहीं किए जाते). भले ही, कोई अपडेट या पुश तरीका न बुलाया गया हो.
इस एपीआई को चलाने के लिए, एडमिन या सेवा खाते की ज़रूरत होती है. इस्तेमाल किया गया सेवा खाता, उस डेटा सोर्स में मौजूद व्हाइटलिस्ट में शामिल होता है.
एचटीटीपी अनुरोध
POST https://cloudsearch.googleapis.com/v1/indexing/{name=datasources/*}/items:poll
यूआरएल में gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल किया गया है.
पाथ पैरामीटर
पैरामीटर |
name |
string
आइटम के लिए पोल करने वाले डेटा सोर्स का नाम. फ़ॉर्मैट: datasources/{sourceId}
|
अनुरोध का मुख्य भाग
अनुरोध के मुख्य भाग में नीचे दिए गए स्ट्रक्चर वाला डेटा होता है:
JSON के काेड में दिखाना |
{
"connectorName": string,
"statusCodes": [
enum (ItemStatus.Code )
],
"limit": integer,
"queue": string,
"debugOptions": {
object (DebugOptions )
}
} |
फ़ील्ड |
connectorName |
string
यह कॉल करने वाले कनेक्टर का नाम. फ़ॉर्मैट: datasources/{sourceId}/connectors/{id}
|
statusCodes[] |
enum (ItemStatus.Code )
सिर्फ़ उन आइटम के लिए पोल करें जिनका स्टेटस इनमें से कोई एक है.
|
limit |
integer
ज़्यादा से ज़्यादा कितने आइटम लौटाए जा सकते हैं. इसकी ज़्यादा से ज़्यादा वैल्यू 100 और डिफ़ॉल्ट वैल्यू 20 होती है.
|
queue |
string
आइटम फ़ेच करने के लिए, सूची का नाम. अगर कोई वैल्यू नहीं दी जाती है, तो items.poll 'डिफ़ॉल्ट' सूची से फ़ेच करेगा. इसमें 100 से ज़्यादा वर्ण नहीं हो सकते.
|
debugOptions |
object (DebugOptions )
डीबग करने के सामान्य विकल्प.
|
जवाब का मुख्य भाग
अगर एपीआई सही से जुड़ जाता है, ताे जवाब के मुख्य भाग में नीचे दिए गए स्ट्रक्चर शामिल होता है.
JSON के काेड में दिखाना |
{
"items": [
{
object (Item )
}
]
} |
फ़ील्ड |
items[] |
object (Item )
कनेक्टर के लिए प्रोसेस करने के लिए, सूची में मौजूद आइटम का सेट. इन आइटम में, फ़ील्ड के ये सबसेट पॉप्युलेट होते हैं: version
metadata.hash
structuredData.hash
content.hash
payload
status
queue
|
अनुमति के दायरे
इसके लिए, OAuth के इनमें से किसी एक स्कोप की ज़रूरत होती है:
https://www.googleapis.com/auth/cloud_search.indexing
https://www.googleapis.com/auth/cloud_search
ज़्यादा जानकारी के लिए, अनुमति से जुड़ी गाइड देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[],[],null,["# Method: indexing.datasources.items.poll\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.PollItemsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nPolls for unreserved items from the indexing queue and marks a set as reserved, starting with items that have the oldest timestamp from the highest priority [ItemStatus](/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code). The priority order is as follows:\n\n[ERROR](/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code#ENUM_VALUES.ERROR)\n\n[MODIFIED](/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code#ENUM_VALUES.MODIFIED)\n\n[NEW_ITEM](/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code#ENUM_VALUES.NEW_ITEM)\n\n[ACCEPTED](/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code#ENUM_VALUES.ACCEPTED)\n\nReserving items ensures that polling from other threads cannot create overlapping sets.\n\nAfter handling the reserved items, the client should put items back into the unreserved state, either by calling [index,](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/index_#google.apps.search.v1.ItemsService.IndexItem) or by calling [push](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#google.apps.search.v1.ItemsService.PushItem) with the type [REQUEUE.](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items/push#PushItem.Type.ENUM_VALUES.REQUEUE)\n\nItems automatically become available (unreserved) after 4 hours even if no update or push method is called.\n\nThis API requires an admin or service account to execute. The service account used is the one whitelisted in the corresponding data source.\n\n### HTTP request\n\n`POST https://cloudsearch.googleapis.com/v1/indexing/{name=datasources/*}/items:poll`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|------------------------------------------------------------------------------------|\n| `name` | `string` The name of the data Source to poll items. Format: datasources/{sourceId} |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"connectorName\": string, \"statusCodes\": [ enum (/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code) ], \"limit\": integer, \"queue\": string, \"debugOptions\": { object (/workspace/cloud-search/docs/reference/rest/v1/DebugOptions) } } ``` |\n\n| Fields ||\n|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `connectorName` | `string` The name of connector making this call. Format: datasources/{sourceId}/connectors/{id} |\n| `statusCodes[]` | `enum (`[ItemStatus.Code](/workspace/cloud-search/docs/reference/rest/v1/ItemStatus.Code)`)` Limit the items polled to the ones with these statuses. |\n| `limit` | `integer` Maximum number of items to return. The maximum value is 100 and the default value is 20. |\n| `queue` | `string` Queue name to fetch items from. If unspecified, items.poll will fetch from 'default' queue. The maximum length is 100 characters. |\n| `debugOptions` | `object (`[DebugOptions](/workspace/cloud-search/docs/reference/rest/v1/DebugOptions)`)` Common debug options. |\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------|\n| ``` { \"items\": [ { object (/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#Item) } ] } ``` |\n\n| Fields ||\n|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `items[]` | `object (`[Item](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#Item)`)` Set of items from the queue available for connector to process. These items have the following subset of fields populated: [version](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#Item.FIELDS.version) [metadata.hash](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#ItemMetadata.FIELDS.hash) [structuredData.hash](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#ItemStructuredData.FIELDS.hash) [content.hash](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#ItemContent.FIELDS.hash) [payload](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#Item.FIELDS.payload) [status](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#Item.FIELDS.status) [queue](/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#Item.FIELDS.queue) |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud_search.indexing`\n- `https://www.googleapis.com/auth/cloud_search`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]