Table of Contents

Interface IQuery

Namespace
Examine.Search
Assembly
Examine.Core.dll

Defines the query methods for the fluent search API

public interface IQuery

Methods

All()

Matches all items

IOrdering All()

Returns

IOrdering

Field(string, IExamineValue)

Query on the specified field

IBooleanOperation Field(string fieldName, IExamineValue fieldValue)

Parameters

fieldName string

Name of the field.

fieldValue IExamineValue

The field value.

Returns

IBooleanOperation

Field(string, string)

Query on the specified field

IBooleanOperation Field(string fieldName, string fieldValue)

Parameters

fieldName string

Name of the field.

fieldValue string

The field value.

Returns

IBooleanOperation

Field<T>(string, T)

Query on the specified field for a struct value which will try to be auto converted with the correct query

IBooleanOperation Field<T>(string fieldName, T fieldValue) where T : struct

Parameters

fieldName string
fieldValue T

Returns

IBooleanOperation

Type Parameters

T

Group(Func<INestedQuery, INestedBooleanOperation>, BooleanOperation)

Creates an inner group query

IBooleanOperation Group(Func<INestedQuery, INestedBooleanOperation> inner, BooleanOperation defaultOp = BooleanOperation.Or)

Parameters

inner Func<INestedQuery, INestedBooleanOperation>
defaultOp BooleanOperation

The default operation is OR, generally a grouped query would have complex inner queries with an OR against another complex group query

Returns

IBooleanOperation

GroupedAnd(IEnumerable<string>, params IExamineValue[])

Queries multiple fields with each being an And boolean operation

IBooleanOperation GroupedAnd(IEnumerable<string> fields, params IExamineValue[] query)

Parameters

fields IEnumerable<string>

The fields.

query IExamineValue[]

The query.

Returns

IBooleanOperation

GroupedAnd(IEnumerable<string>, params string[])

Queries multiple fields with each being an And boolean operation

IBooleanOperation GroupedAnd(IEnumerable<string> fields, params string[] query)

Parameters

fields IEnumerable<string>

The fields.

query string[]

The query.

Returns

IBooleanOperation

GroupedNot(IEnumerable<string>, params IExamineValue[])

Queries multiple fields with each being an Not boolean operation

IBooleanOperation GroupedNot(IEnumerable<string> fields, params IExamineValue[] query)

Parameters

fields IEnumerable<string>

The fields.

query IExamineValue[]

The query.

Returns

IBooleanOperation

GroupedNot(IEnumerable<string>, params string[])

Queries multiple fields with each being an Not boolean operation

IBooleanOperation GroupedNot(IEnumerable<string> fields, params string[] query)

Parameters

fields IEnumerable<string>

The fields.

query string[]

The query.

Returns

IBooleanOperation

GroupedOr(IEnumerable<string>, params IExamineValue[])

Queries multiple fields with each being an Or boolean operation

IBooleanOperation GroupedOr(IEnumerable<string> fields, params IExamineValue[] query)

Parameters

fields IEnumerable<string>

The fields.

query IExamineValue[]

The query.

Returns

IBooleanOperation

GroupedOr(IEnumerable<string>, params string[])

Queries multiple fields with each being an Or boolean operation

IBooleanOperation GroupedOr(IEnumerable<string> fields, params string[] query)

Parameters

fields IEnumerable<string>

The fields.

query string[]

The query.

Returns

IBooleanOperation

Id(string)

Query on the id

IBooleanOperation Id(string id)

Parameters

id string

The id.

Returns

IBooleanOperation

ManagedQuery(string, string[]?)

The index will determine the most appropriate way to search given the query and the fields provided

IBooleanOperation ManagedQuery(string query, string[]? fields = null)

Parameters

query string
fields string[]

Returns

IBooleanOperation

NativeQuery(string)

Passes a text string which is preformatted for the underlying search API. Examine will not modify this

IBooleanOperation NativeQuery(string query)

Parameters

query string

The query.

Returns

IBooleanOperation

Remarks

This allows a developer to completely bypass and Examine logic and comprise their own query text which they are passing in. It means that if the search is too complex to achieve with the fluent API, or too dynamic to achieve with a static language the provider can still handle it.

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

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