You are here: Symbol Reference > dtSearch.Engine Namespace > SearchResults Class > SearchResults Methods > AddDocs Method
dtSearch .NET Standard API 2023.01
SearchResults.AddDocs Method

Add documents to SearchResults.

public void AddDocs( string indexPath, int[] docIds );
Path of the index that contains the documents.
Document ids of the documents to add.

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; }
Copyright (c) 1998-2022 dtSearch Corp. All rights reserved.