SearchQuery Class |
Namespace: GroupDocs.Search
The SearchQuery type exposes the following members.
Name | Description | |
---|---|---|
ChildCount |
Gets the number of child queries.
| |
FieldName |
Gets the field name.
| |
FirstChild |
Gets the first child query.
| |
SearchOptions |
Gets or sets the search options of this seach query.
| |
SecondChild |
Gets the second child query.
|
Name | Description | |
---|---|---|
CreateAndQuery |
Creates a combined query that will find only documents which will be found for each original query.
| |
CreateDateRangeQuery |
Creates a date range query.
| |
CreateFieldQuery |
Adds a field to the specified query.
| |
CreateNotQuery |
Creates an inverted query that will find the rest documents in an index against ones which will be found for the original query.
| |
CreateNumericRangeQuery |
Creates a numeric range query.
| |
CreateOrQuery |
Creates a combined query that will find all the documents which will be found at least for one of the original queries.
| |
CreatePhraseSearchQuery |
Creates a phrase search query.
| |
CreateRegexQuery(String) |
Creates a regular expression query.
| |
CreateRegexQuery(String, RegexOptions) |
Creates a regular expression query.
| |
CreateWildcardQuery(Int32) |
Creates a wildcard for the phrase search.
| |
CreateWildcardQuery(Int32, Int32) |
Creates a wildcard for the phrase search.
| |
CreateWordPatternQuery |
Creates a word pattern query.
| |
CreateWordQuery |
Creates a simple word query.
| |
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetChild |
Gets a child query by an index.
| |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
MemberwiseClone | (Inherited from Object.) | |
ToString |
Returns a String that represents the current SearchQuery instance.
(Overrides ObjectToString.) |
string indexFolder = @"c:\MyIndex\"; string documentsFolder = @"c:\MyDocuments\"; Index index = new Index(indexFolder); // Creating index in the specified folder index.Add(documentsFolder); // Indexing documents from the specified folder // Creating subquery of date range search SearchQuery subquery1 = SearchQuery.CreateDateRangeQuery(new DateTime(2011, 6, 17), new DateTime(2013, 1, 1)); // Creating subquery of wildcard with number of missed words from 0 to 2 SearchQuery subquery2 = SearchQuery.CreateWildcardQuery(0, 2); // Creating subquery of simple word SearchQuery subquery3 = SearchQuery.CreateWordQuery("birth"); subquery3.SearchOptions = new SearchOptions(); // Setting search options only for subquery 3 subquery3.SearchOptions.FuzzySearch.Enabled = true; subquery3.SearchOptions.FuzzySearch.FuzzyAlgorithm = new TableDiscreteFunction(1); // Combining subqueries into one query SearchQuery query = SearchQuery.CreatePhraseSearchQuery(subquery1, subquery2, subquery3); // Creating search options object with increased capacity of found occurrences SearchOptions options = new SearchOptions(); // Overall search options options.MaxOccurrenceCountPerTerm = 1000000; options.MaxTotalOccurrenceCount = 10000000; SearchResult result = index.Search(query, options); // Searching