Class LuceneSearchQuery
This class is used to query against Lucene.Net
public class LuceneSearchQuery : LuceneSearchQueryBase, IQuery, INestedQuery, IQueryExecutor
- Inheritance
-
LuceneSearchQuery
- Implements
- Inherited Members
- Extension Methods
Constructors
LuceneSearchQuery(ISearchContext, string, Analyzer, LuceneSearchOptions, BooleanOperation)
[Obsolete("To be removed in Examine V5")]
public LuceneSearchQuery(ISearchContext searchContext, string category, Analyzer analyzer, LuceneSearchOptions searchOptions, BooleanOperation occurance)
Parameters
searchContextISearchContextcategorystringanalyzerAnalyzersearchOptionsLuceneSearchOptionsoccuranceBooleanOperation
LuceneSearchQuery(ISearchContext, string?, Analyzer, LuceneSearchOptions, BooleanOperation, FacetsConfig)
public LuceneSearchQuery(ISearchContext searchContext, string? category, Analyzer analyzer, LuceneSearchOptions searchOptions, BooleanOperation occurance, FacetsConfig facetsConfig)
Parameters
searchContextISearchContextcategorystringanalyzerAnalyzersearchOptionsLuceneSearchOptionsoccuranceBooleanOperationfacetsConfigFacetsConfig
Methods
CreateOp()
Creates a new LuceneBooleanOperation
protected override LuceneBooleanOperationBase CreateOp()
Returns
Execute(QueryOptions?)
Executes the query
public ISearchResults Execute(QueryOptions? options = null)
Parameters
optionsQueryOptions
Returns
FieldNested<T>(string, T)
Query on a specific field
protected override INestedBooleanOperation FieldNested<T>(string fieldName, T fieldValue) where T : struct
Parameters
fieldNamestringfieldValueT
Returns
Type Parameters
T
Field<T>(string, T)
Query on the specified field for a struct value which will try to be auto converted with the correct query
public override IBooleanOperation Field<T>(string fieldName, T fieldValue) where T : struct
Parameters
fieldNamestringfieldValueT
Returns
Type Parameters
T
ManagedQuery(string, string[]?)
The index will determine the most appropriate way to search given the query and the fields provided
public override IBooleanOperation ManagedQuery(string query, string[]? fields = null)
Parameters
Returns
ManagedQueryNested(string, string[]?)
The index will determine the most appropiate way to query the fields specified
protected override INestedBooleanOperation ManagedQueryNested(string query, string[]? fields = null)
Parameters
Returns
OrderBy(params SortableField[])
Sets the order by of the query
public virtual IBooleanOperation OrderBy(params SortableField[] fields)
Parameters
fieldsSortableField[]
Returns
OrderByDescending(params SortableField[])
Sets the order by of the query in a descending manner
public virtual IBooleanOperation OrderByDescending(params SortableField[] fields)
Parameters
fieldsSortableField[]
Returns
RangeQueryNested<T>(string[], T?, T?, bool, bool)
Matches items as defined by the IIndexFieldValueType used for the fields specified. If a type is not defined for a field name, or the type does not implement IIndexRangeValueType for the types of min and max, nothing will be added
protected override INestedBooleanOperation RangeQueryNested<T>(string[] fields, T? min, T? max, bool minInclusive = true, bool maxInclusive = true) where T : struct
Parameters
Returns
Type Parameters
T
RangeQuery<T>(string[], T?, T?, bool, bool)
Matches items as defined by the IIndexFieldValueType used for the fields specified. If a type is not defined for a field name, or the type does not implement IIndexRangeValueType for the types of min and max, nothing will be added
public override IBooleanOperation RangeQuery<T>(string[] fields, T? min, T? max, bool minInclusive = true, bool maxInclusive = true) where T : struct
Parameters
Returns
Type Parameters
T
SelectAllFieldsInternal()
Selects all fields
public IBooleanOperation SelectAllFieldsInternal()