IndexSearchNext Method (ChunkSearchToken, Cancellation)
Continues the chunk search started with method Search.

Namespace: GroupDocs.Search
Assembly: GroupDocs.Search (in GroupDocs.Search.dll) Version: 20.6
Syntax
public SearchResult SearchNext(
	ChunkSearchToken chunkSearchToken,
	Cancellation cancellation
)

Parameters

chunkSearchToken
Type: GroupDocs.Search.CommonChunkSearchToken
The chunk search token.
cancellation
Type: GroupDocs.Search.CommonCancellation
The cancellation object.

Return Value

Type: SearchResult
The search result.
Examples
The example demonstrates how to perform search using query in object form.
C#
string indexFolder = @"c:\MyIndex\";
string documentsFolder = @"c:\MyDocuments\";
string query = "Einstein";

Index index = new Index(indexFolder); // Creating index in the specified folder
index.Add(documentsFolder); // Indexing documents from the specified folder

Cancellation cancellation = new Cancellation(); // This cancellation object aborts all search continuations if canceled
SearchOptions options = new SearchOptions();
options.IsChunkSearch = true; // Enabling chunk search
options.Cancellation = cancellation;

SearchResult result = index.Search(query, options); // Starting chunk search
Console.WriteLine("Document count: " + result.DocumentCount);
Console.WriteLine("Occurrence count: " + result.OccurrenceCount);

while (result.NextChunkSearchToken != null)
{
    result = index.SearchNext(result.NextChunkSearchToken, cancellation); // Continuing chunk search
    Console.WriteLine("Document count: " + result.DocumentCount);
    Console.WriteLine("Occurrence count: " + result.OccurrenceCount);
}
See Also