Class GetManyExtensions
Provides GetMany extensions that make it easier to get many documents given a list of ids
Inherited Members
Namespace: OpenSearch.Client
Assembly: OpenSearch.Client.dll
Syntax
public static class GetManyExtensions
Methods
| Edit this page View SourceGetManyAsync<T>(IOpenSearchClient, IEnumerable<long>, IndexName, CancellationToken)
Multi GET API allows to get multiple documents based on an index, type (optional) and id (and possibly routing). The response includes a docs array with all the fetched documents, each element similar in structure to a document provided by the get API.
https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/multi-get/
Declaration
public static Task<IEnumerable<IMultiGetHit<T>>> GetManyAsync<T>(this IOpenSearchClient client, IEnumerable<long> ids, IndexName index = null, CancellationToken cancellationToken = default) where T : class
Parameters
Type | Name | Description |
---|---|---|
IOpenSearchClient | client | |
IEnumerable<long> | ids | IEnumerable of ids as ints for the documents to fetch |
IndexName | index | Optionally override the default inferred index name for T |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<IMultiGetHit<T>>> |
Type Parameters
Name | Description |
---|---|
T | The type used to infer the default index and typename |
GetManyAsync<T>(IOpenSearchClient, IEnumerable<string>, IndexName, CancellationToken)
Multi GET API allows to get multiple documents based on an index, type (optional) and id (and possibly routing). The response includes a docs array with all the fetched documents, each element similar in structure to a document provided by the get API.
https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/multi-get/
Declaration
public static Task<IEnumerable<IMultiGetHit<T>>> GetManyAsync<T>(this IOpenSearchClient client, IEnumerable<string> ids, IndexName index = null, CancellationToken cancellationToken = default) where T : class
Parameters
Type | Name | Description |
---|---|---|
IOpenSearchClient | client | |
IEnumerable<string> | ids | IEnumerable of ids as string for the documents to fetch |
IndexName | index | Optionally override the default inferred index name for T |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<IMultiGetHit<T>>> |
Type Parameters
Name | Description |
---|---|
T | The type used to infer the default index and typename |
GetMany<T>(IOpenSearchClient, IEnumerable<long>, IndexName)
Multi GET API allows to get multiple documents based on an index, type (optional) and id (and possibly routing). The response includes a docs array with all the fetched documents, each element similar in structure to a document provided by the get API.
https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/multi-get/
Declaration
public static IEnumerable<IMultiGetHit<T>> GetMany<T>(this IOpenSearchClient client, IEnumerable<long> ids, IndexName index = null) where T : class
Parameters
Type | Name | Description |
---|---|---|
IOpenSearchClient | client | |
IEnumerable<long> | ids | IEnumerable of ids as ints for the documents to fetch |
IndexName | index | Optionally override the default inferred index name for T |
Returns
Type | Description |
---|---|
IEnumerable<IMultiGetHit<T>> |
Type Parameters
Name | Description |
---|---|
T | The type used to infer the default index and typename |
GetMany<T>(IOpenSearchClient, IEnumerable<string>, IndexName)
Multi GET API allows to get multiple documents based on an index, type (optional) and id (and possibly routing). The response includes a docs array with all the fetched documents, each element similar in structure to a document provided by the get API.
https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/multi-get/
Declaration
public static IEnumerable<IMultiGetHit<T>> GetMany<T>(this IOpenSearchClient client, IEnumerable<string> ids, IndexName index = null) where T : class
Parameters
Type | Name | Description |
---|---|---|
IOpenSearchClient | client | |
IEnumerable<string> | ids | IEnumerable of ids as string for the documents to fetch |
IndexName | index | Optionally override the default inferred index name for T |
Returns
Type | Description |
---|---|
IEnumerable<IMultiGetHit<T>> |
Type Parameters
Name | Description |
---|---|
T | The type used to infer the default index and typename |