Table of Contents

Class LuceneSearchQuery

Namespace
Examine.Lucene.Search
Assembly
Examine.Lucene.dll

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 ISearchContext
category string
analyzer Analyzer
searchOptions LuceneSearchOptions
occurance BooleanOperation

LuceneSearchQuery(ISearchContext, string?, Analyzer, LuceneSearchOptions, BooleanOperation, FacetsConfig)

public LuceneSearchQuery(ISearchContext searchContext, string? category, Analyzer analyzer, LuceneSearchOptions searchOptions, BooleanOperation occurance, FacetsConfig facetsConfig)

Parameters

searchContext ISearchContext
category string
analyzer Analyzer
searchOptions LuceneSearchOptions
occurance BooleanOperation
facetsConfig FacetsConfig

Methods

CreateOp()

Creates a new LuceneBooleanOperation

protected override LuceneBooleanOperationBase CreateOp()

Returns

LuceneBooleanOperationBase

Execute(QueryOptions?)

Executes the query

public ISearchResults Execute(QueryOptions? options = null)

Parameters

options QueryOptions

Returns

ISearchResults

FieldNested<T>(string, T)

Query on a specific field

protected override INestedBooleanOperation FieldNested<T>(string fieldName, T fieldValue) where T : struct

Parameters

fieldName string
fieldValue T

Returns

INestedBooleanOperation

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 string
fieldValue T

Returns

IBooleanOperation

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

query string
fields string[]

Returns

IBooleanOperation

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

query string
fields string[]

Returns

INestedBooleanOperation

OrderBy(params SortableField[])

Sets the order by of the query

public virtual IBooleanOperation OrderBy(params SortableField[] fields)

Parameters

fields SortableField[]

Returns

IBooleanOperation

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

IBooleanOperation

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

fields string[]
min T?
max T?
minInclusive bool
maxInclusive bool

Returns

INestedBooleanOperation

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

fields string[]
min T?
max T?
minInclusive bool
maxInclusive bool

Returns

IBooleanOperation

Type Parameters

T

SelectAllFieldsInternal()

Selects all fields

public IBooleanOperation SelectAllFieldsInternal()

Returns

IBooleanOperation