Table of Contents

Class Search

Namespace
Amazon.DynamoDBv2.DocumentModel
Assembly
AWSSDK.DynamoDBv2.dll

Search response object

public class Search
Inheritance
Search
Inherited Members

Properties

AttributesToGet

List of attribute names to retrieve

public List<string> AttributesToGet { get; }

Property Value

List<string>

CollectResults

Whether to collect GetNextSet and GetRemaining results in Matches property. Default is true. If set to false, Matches will always be empty.

public bool CollectResults { get; }

Property Value

bool

ConditionalOperator

Conditional operator for the search operation

public ConditionalOperatorValues ConditionalOperator { get; }

Property Value

ConditionalOperatorValues

Count

Gets the total number of items that match the search parameters.

If IsDone is true and CollectResults is true, returns Matches.Count. Otherwise, makes a call to DynamoDB to find out the number of matching items, without retrieving the items. Count is then cached.

public int Count { get; }

Property Value

int

Filter

Filter for the search operation This applies to Query and Scan operations.

public Filter Filter { get; }

Property Value

Filter

FilterExpression

The filter expression that is evaluated for each item. This applies to Query and Scan operations.

public Expression FilterExpression { get; set; }

Property Value

Expression

IndexName

Name of the index to query or scan against.

public string IndexName { get; }

Property Value

string

IsBackwardSearch

Flag that, if true, indicates that the search is traversing backwards

public bool IsBackwardSearch { get; }

Property Value

bool

IsConsistentRead

Flag that, if true, indicates that the search is operating in consistent-read mode

public bool IsConsistentRead { get; }

Property Value

bool

IsDone

Flag that, if true, indicates that the search is done

public bool IsDone { get; }

Property Value

bool

KeyExpression

The key expression that is evaluated for each item of a query. This applies only to Query operations.

public Expression KeyExpression { get; set; }

Property Value

Expression

Limit

Upper limit on the number of items returned. For Queries: upper limit on the number of items returned. For Scan: limit on the number of items scanned.

Maps directly to Limit property on Query and Scan operations.

public int Limit { get; }

Property Value

int

Matches

List of currently found items

public List<Document> Matches { get; }

Property Value

List<Document>

NextKey

Key denoting the starting point of the next set of results

public Dictionary<string, AttributeValue> NextKey { get; }

Property Value

Dictionary<string, AttributeValue>

PaginationToken

Pagination token corresponding to the item where the search operation stopped, inclusive of the previous result set. Use this value to start a new operation to resume search from the next item.

public string PaginationToken { get; }

Property Value

string

Segment

For parallel Scan requests, Segment identifies an individual segment to be scanned by an application "worker" (such as a thread or a process). Each worker issues a Scan request with a distinct value for the segment it will scan. Segment IDs are zero-based, so the first segment is always 0. For example, if you want to scan a table using four application threads, the first thread would specify a Segment value of 0, the second thread would specify 1, and so on. LastEvaluatedKey returned from a parallel scan request must be used with same Segment id in a subsequent operation. The value for Segment must be less than or equal to 0, and less than the value provided for TotalSegments. If you specify Segment, you must also specify TotalSegments.

Constraints:

public int Segment { get; set; }

Property Value

int

Select

Enum specifying what data to return from query.

public SelectValues Select { get; }

Property Value

SelectValues

TableName

Name of the table being searched

public string TableName { get; }

Property Value

string

TotalSegments

For parallel Scan requests, TotalSegmentsrepresents the total number of segments for a table that is being scanned. Segments are a way to logically divide a table into equally sized portions, for the duration of the Scan request. The value of TotalSegments corresponds to the number of application "workers" (such as threads or processes) that will perform the parallel Scan. For example, if you want to scan a table using four application threads, you would specify a TotalSegments value of 4. The value for TotalSegments must be greater than or equal to 1, and less than or equal to 4096. If you specify a TotalSegments value of 1, the Scan will be sequential rather than parallel. If you specify TotalSegments, you must also specify Segment.

Constraints:

public int TotalSegments { get; set; }

Property Value

int

Methods

GetNextSetAsync(CancellationToken)

Initiates the asynchronous execution of the GetNextSet operation.

If there are more items in the Scan/Query, PaginationToken will be set and can be consumed in a new Scan/Query operation to resume retrieving items from this point. Amazon.DynamoDBv2.DocumentModel.Search.GetNextSet

public Task<List<Document>> GetNextSetAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Token which can be used to cancel the task.

Returns

Task<List<Document>>

A Task that can be used to poll or wait for results, or both.

GetRemainingAsync(CancellationToken)

Initiates the asynchronous execution of the GetRemaining operation. Amazon.DynamoDBv2.DocumentModel.Search.GetRemaining

public Task<List<Document>> GetRemainingAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Token which can be used to cancel the task.

Returns

Task<List<Document>>

A Task that can be used to poll or wait for results, or both.