Search
Contents
[
Hide
]
Search(string)
Searches in all indexes of the repository.
public SearchResult Search(string query)
Parameter | Type | Description |
---|---|---|
query | String | The search query. |
Return Value
The search result.
Examples
The example demonstrates how to perform search in index repository.
string indexFolder = @"c:\MyIndex\";
string documentsFolder = @"c:\MyDocuments\";
string query = "Einstein";
IndexRepository repository = new IndexRepository();
Index index = repository.Create(indexFolder); // Creating index
index.Add(documentsFolder); // Indexing documents
SearchResult result = repository.Search(query); // Searching
See Also
- class SearchResult
- class IndexRepository
- namespace GroupDocs.Search
- assembly GroupDocs.Search
Search(string, SearchOptions)
Searches in all indexes of the repository.
public SearchResult Search(string query, SearchOptions options)
Parameter | Type | Description |
---|---|---|
query | String | The search query. |
options | SearchOptions | The search options. |
Return Value
The search result.
Examples
The example demonstrates how to perform search in index repository.
string indexFolder = @"c:\MyIndex\";
string documentsFolder = @"c:\MyDocuments\";
string query = "Einstein";
IndexRepository repository = new IndexRepository();
Index index = repository.Create(indexFolder); // Creating index
index.Add(documentsFolder); // Indexing documents
SearchOptions options = new SearchOptions();
options.UseCaseSensitiveSearch = true; // Setting flag of case sensitive search
SearchResult result = repository.Search(query, options); // Searching
See Also
- class SearchResult
- class SearchOptions
- class IndexRepository
- namespace GroupDocs.Search
- assembly GroupDocs.Search
Search(SearchQuery)
Searches in all indexes of the repository.
public SearchResult Search(SearchQuery query)
Parameter | Type | Description |
---|---|---|
query | SearchQuery | The search query. |
Return Value
The search result.
Examples
The example demonstrates how to perform search in index repository.
string indexFolder = @"c:\MyIndex\";
string documentsFolder = @"c:\MyDocuments\";
IndexRepository repository = new IndexRepository();
Index index = repository.Create(indexFolder); // Creating index
index.Add(documentsFolder); // Indexing documents
SearchQuery query = SearchQuery.CreateWordQuery("Einstein"); // Creating search query in object form
SearchResult result = repository.Search(query); // Searching
See Also
- class SearchResult
- class SearchQuery
- class IndexRepository
- namespace GroupDocs.Search
- assembly GroupDocs.Search
Search(SearchQuery, SearchOptions)
Searches in all indexes of the repository.
public SearchResult Search(SearchQuery query, SearchOptions options)
Parameter | Type | Description |
---|---|---|
query | SearchQuery | The search query. |
options | SearchOptions | The search options. |
Return Value
The search result.
Examples
The example demonstrates how to perform search in index repository.
string indexFolder = @"c:\MyIndex\";
string documentsFolder = @"c:\MyDocuments\";
IndexRepository repository = new IndexRepository();
Index index = repository.Create(indexFolder); // Creating index
index.Add(documentsFolder); // Indexing documents
SearchOptions options = new SearchOptions();
options.UseCaseSensitiveSearch = true; // Setting flag of case sensitive search
SearchQuery query = SearchQuery.CreateWordQuery("Einstein"); // Creating search query in object form
SearchResult result = repository.Search(query, options); // Searching
See Also
- class SearchResult
- class SearchQuery
- class SearchOptions
- class IndexRepository
- namespace GroupDocs.Search
- assembly GroupDocs.Search