Table of Contents

Method Term

Namespace
TantivyDotNet
Assembly
TantivyDotNet.dll

Term(string, string)

Matches documents whose field contains exactly value. For a JSON field, field is a path such as attrs.color.

public static TermQuery Term(string field, string value)

Parameters

field string
value string

Returns

TermQuery

Remarks

The value is not analyzed: with the default tokenizer, text is indexed lowercased, so Term("title", "Mice") matches nothing while Term("title", "mice") does. Use Phrase(string, string, int) or Parse(string, QueryParserOptions) to have the text analyzed, or a string field (AddStringField(string, bool, bool)) for exact identifiers.

Term(string, ulong)

Matches documents whose field contains exactly value. For a JSON field, field is a path such as attrs.color.

public static TermQuery Term(string field, ulong value)

Parameters

field string
value ulong

Returns

TermQuery

Term(string, long)

Matches documents whose field contains exactly value. Also works on u64 fields (for non-negative values) and f64 fields.

public static TermQuery Term(string field, long value)

Parameters

field string
value long

Returns

TermQuery

Term(string, double)

Matches documents whose field contains exactly value. For a JSON field, field is a path such as attrs.color.

public static TermQuery Term(string field, double value)

Parameters

field string
value double

Returns

TermQuery

Term(string, bool)

Matches documents whose field contains exactly value. For a JSON field, field is a path such as attrs.color.

public static TermQuery Term(string field, bool value)

Parameters

field string
value bool

Returns

TermQuery

Term(string, DateTimeOffset)

Matches documents whose date field equals value, at the index's date precision (seconds by default).

public static TermQuery Term(string field, DateTimeOffset value)

Parameters

field string
value DateTimeOffset

Returns

TermQuery

Term(string, DateTime)

Matches documents whose date field equals value, at the index's date precision (seconds by default).

public static TermQuery Term(string field, DateTime value)

Parameters

field string
value DateTime

Returns

TermQuery

Remarks

A Unspecified value is treated as UTC.

Term(string, ReadOnlySpan<byte>)

Matches documents whose field contains exactly value. For a JSON field, field is a path such as attrs.color.

public static TermQuery Term(string field, ReadOnlySpan<byte> value)

Parameters

field string
value ReadOnlySpan<byte>

Returns

TermQuery

Term(string, IPAddress)

Matches documents whose IP address field equals value (IPv4 also matches its IPv4-mapped IPv6 form).

public static TermQuery Term(string field, IPAddress value)

Parameters

field string
value IPAddress

Returns

TermQuery