To run a text search, use the SearchFirst method of the Searcher class. This method returns the first portion of results.
To continue the search, the SearchNext method is used, returning the second and subsequent portions of results.
Text and object forms of the search query are supported when appropriate overloads of the SearchFirst method are used. The options for a network search are the same as those for a single index search.
The following code example demonstrates performing a full-text search on the search network.
C#
Searchersearcher=node.Searcher;SearchQueryquery=SearchQuery.CreateWordQuery(word);Console.WriteLine();Console.WriteLine("First time search for: "+query);SearchOptionsoptions=newSearchOptions();options.IsChunkSearch=true;options.UseSynonymSearch=useSynonymSearch;inttotalOccurrences=0;List<NetworkFoundDocument>documents=newList<NetworkFoundDocument>();NetworkSearchResultresult=searcher.SearchFirst(query,options);AddDocsFromResult(documents,result);totalOccurrences+=result.OccurrenceCount;TraceResult(result);while(result.NextChunkSearchToken!=null){Console.WriteLine();Console.WriteLine("Next time search for: "+query);result=searcher.SearchNext(result.NextChunkSearchToken);AddDocsFromResult(documents,result);totalOccurrences+=result.OccurrenceCount;TraceResult(result);}Console.WriteLine();Console.WriteLine("Total occurrences: "+totalOccurrences);