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
searchContext
ISearchContextcategory
stringanalyzer
AnalyzersearchOptions
LuceneSearchOptionsoccurance
BooleanOperation
LuceneSearchQuery(ISearchContext, string?, Analyzer, LuceneSearchOptions, BooleanOperation, FacetsConfig)
public LuceneSearchQuery(ISearchContext searchContext, string? category, Analyzer analyzer, LuceneSearchOptions searchOptions, BooleanOperation occurance, FacetsConfig facetsConfig)
Parameters
searchContext
ISearchContextcategory
stringanalyzer
AnalyzersearchOptions
LuceneSearchOptionsoccurance
BooleanOperationfacetsConfig
FacetsConfig
Properties
SearchContext
public ISearchContext SearchContext { get; }
Property Value
Methods
CreateOp()
Creates a new LuceneBooleanOperation
protected override LuceneBooleanOperationBase CreateOp()
Returns
DrillDownQuery(Action<IDrillDownQueryDimensions>, Func<INestedQuery, INestedBooleanOperation>?, Action<IDrillSideways>?, BooleanOperation)
Query for drill-down over facet categories. Call dimensions.Add() for each group of categories to drill-down over
public override IOrdering DrillDownQuery(Action<IDrillDownQueryDimensions> dimensions, Func<INestedQuery, INestedBooleanOperation>? baseQuery = null, Action<IDrillSideways>? drillSideways = null, BooleanOperation defaultOp = BooleanOperation.Or)
Parameters
dimensions
Action<IDrillDownQueryDimensions>Facet Dimensions to Drill Down
baseQuery
Func<INestedQuery, INestedBooleanOperation>Base Query to Drill Down on
drillSideways
Action<IDrillSideways>Facet Dimensions to Drill Sideways
defaultOp
BooleanOperationBase Query default Op
Returns
Execute(QueryOptions?)
Executes the query
public ISearchResults Execute(QueryOptions? options = null)
Parameters
options
QueryOptions
Returns
FieldNested<T>(string, T)
Query on a specific field
protected override INestedBooleanOperation FieldNested<T>(string fieldName, T fieldValue) where T : struct
Parameters
fieldName
stringfieldValue
T
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
fieldName
stringfieldValue
T
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
fields
SortableField[]
Returns
OrderByDescending(params SortableField[])
Sets the order by of the query in a descending manner
public virtual IBooleanOperation OrderByDescending(params SortableField[] fields)
Parameters
fields
SortableField[]
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()
Returns
SetSearchAfter(SearchAfter)
Set the SearchAfter to continue the search from a previous position
public virtual void SetSearchAfter(SearchAfter searchAfter)
Parameters
searchAfter
SearchAfterSearch After Options
SpatialOperationQuery(string, ExamineSpatialOperation, Func<IExamineSpatialShapeFactory, IExamineSpatialShape>)
Executes Spatial operation on field and shape as a Query
public override IBooleanOperation SpatialOperationQuery(string field, ExamineSpatialOperation spatialOperation, Func<IExamineSpatialShapeFactory, IExamineSpatialShape> shape)
Parameters
field
stringIndex field name
spatialOperation
ExamineSpatialOperationshape
Func<IExamineSpatialShapeFactory, IExamineSpatialShape>Shape
Returns
WithFilter(Action<IFilter>)
Apply a filter
public override IQuery WithFilter(Action<IFilter> filter)