See Also
dtSearch Text Retrieval Engine -- .NET API (.NET 2.0-4.0) 7.70
SearchResults::AddDocs Method

Add documents to SearchResults.

C#
public AddDocs(ref String indexPath, ref array<long> docIds);
Visual Basic
Public Sub AddDocs(ByRef indexPath As String, ByRef docIds As array<long>)
Parameters
Parameters 
Description 
indexPath 
Path of the index that contains the documents. 
docIds 
Document ids of the documents to add. 
Remarks

When adding more than one document to SearchResults, AddDocs is faster than AddDoc because the index is only opened once. 

SearchResults.AddDocs can be used to convert a SearchFilter to a SearchResults object containing the same documents. First call SearchFilter.GetItems() to get an array the of document ids in the SearchFilter, and then call SearchResults.AddDocs() to add the document ids to a SearchResults object. Example:

private SearchResults ConvertFilterToResults(SearchFilter filter, int iIndex)
        {
            int[] docIds = filter.GetItems(iIndex);
            SearchResults results = new SearchResults();
            results.AddDocs(filter.getIndexPath(iIndex), docIds);
            return results;
        }
See Also
You are here: dtSearch::Engine Namespace > SearchResults Class > SearchResults Methods > AddDocs Method
Copyright (c) 1998-2012 dtSearch Corp. All rights reserved.