The chunk search token is not a token of a search by chunks of the repository.
ObjectDisposedException
The index of the next chunk is disposed.
Remarks
The chunks of the indexes of the repository follow one another: the next chunk of the same index, or the first chunk of the next index. The search goes through the indexes that the repository had when the search started, and NextChunkSearchToken is null after the last chunk of the last index.
The errors of the search of a chunk are reported as SearchNext reports them: by the ErrorOccurred event of the index and of the repository, and in Warnings of the result.
Examples
The example demonstrates how to perform a search by chunks in an index repository.
stringindexFolder1=@"c:\MyIndex1\";stringindexFolder2=@"c:\MyIndex2\";stringdocumentsFolder1=@"c:\MyDocuments1\";stringdocumentsFolder2=@"c:\MyDocuments2\";stringquery="Einstein";IndexRepositoryrepository=newIndexRepository();Indexindex1=repository.Create(indexFolder1);// Creating the first indexindex1.Add(documentsFolder1);// Indexing documentsIndexindex2=repository.Create(indexFolder2);// Creating the second indexindex2.Add(documentsFolder2);SearchOptionsoptions=newSearchOptions();options.IsChunkSearch=true;// Enabling the search by chunksSearchResultresult=repository.Search(query,options);// Starting the search by chunksConsole.WriteLine("Document count: "+result.DocumentCount);while(result.NextChunkSearchToken!=null){result=repository.SearchNext(result.NextChunkSearchToken);// Continuing the search by chunksConsole.WriteLine("Document count: "+result.DocumentCount);}
The chunk search token is not a token of a search by chunks of the repository.
ObjectDisposedException
The index of the next chunk is disposed.
Remarks
The chunks of the indexes of the repository follow one another: the next chunk of the same index, or the first chunk of the next index. The search goes through the indexes that the repository had when the search started, and NextChunkSearchToken is null after the last chunk of the last index.
The errors of the search of a chunk are reported as SearchNext reports them: by the ErrorOccurred event of the index and of the repository, and in Warnings of the result.
Examples
The example demonstrates how to perform a search by chunks in an index repository.
stringindexFolder1=@"c:\MyIndex1\";stringindexFolder2=@"c:\MyIndex2\";stringdocumentsFolder1=@"c:\MyDocuments1\";stringdocumentsFolder2=@"c:\MyDocuments2\";stringquery="Einstein";IndexRepositoryrepository=newIndexRepository();Indexindex1=repository.Create(indexFolder1);// Creating the first indexindex1.Add(documentsFolder1);// Indexing documentsIndexindex2=repository.Create(indexFolder2);// Creating the second indexindex2.Add(documentsFolder2);Cancellationcancellation=newCancellation();// The cancellation of the search and of its continuationsSearchOptionsoptions=newSearchOptions();options.IsChunkSearch=true;// Enabling the search by chunksoptions.Cancellation=cancellation;SearchResultresult=repository.Search(query,options);// Starting the search by chunksConsole.WriteLine("Document count: "+result.DocumentCount);while(result.NextChunkSearchToken!=null){// Continuing the search by chunksresult=repository.SearchNext(result.NextChunkSearchToken,cancellation);Console.WriteLine("Document count: "+result.DocumentCount);}