Table of Contents

Namespace TantivyDotNet

Classes

AllQuery

Matches every document. Use All.

Analyzer

A custom text analyzer: a tokenizer that splits text into tokens, followed by filters that transform or drop tokens. Register it with AddAnalyzer(string, Analyzer) and use its name as a text field's tokenizer.

BooleanQuery

A combination of clauses. Created by Boolean(IEnumerable<Query>?, IEnumerable<Query>?, IEnumerable<Query>?) or the &, | and ! operators.

BoostQuery

A query whose scores are scaled. Created by Boost(float).

ConstantScoreQuery

A query whose matches all get one score. Created by ConstantScore(float).

DisjunctionMaxQuery

A best-of-alternatives match. Created by DisjunctionMax(IEnumerable<Query>, float).

Document

The stored fields of a search hit. Only fields marked stored in the schema are present. Every field can hold several values; the Get* methods return the first one.

ExistsQuery

A has-a-value match. Created by Exists(string).

Explanation

How a document's score was computed: a tree whose nodes each contribute a value. Returned by Explain(Query, SearchHit), for debugging relevance.

FacetCount

The number of matching documents in one facet category (including its subcategories).

FacetQuery

A facet-category match. Created by Facet(string, string).

FacetRequest

Asks Search(Query, SearchOptions) to count the matching documents in each child category of some facet paths. The counts appear in Facets under Field.

FieldDefinition

One field of a Schema. Add fields with SchemaBuilder.

FieldStats

Bytes used by one field across all segments, in Fields. Components the field doesn't have are 0.

FuzzyOptions

Fuzzy matching for a field in FuzzyFields; see Fuzzy(string, string, int, bool, bool).

FuzzyQuery

An approximate-term match. Created by Fuzzy(string, string, int, bool, bool).

GarbageCollectionResult

The result of GarbageCollectFiles().

IndexSettings

Settings chosen when an index is created (Create(string, Schema, IndexSettings?), CreateInRam(Schema, IndexSettings?)). They're saved with the index and can't be changed later; Settings reports them.

IndexStats

Statistics of one index snapshot, from GetStats() or GetStats().

IndexWriter

Adds and deletes documents. Changes become visible to new searchers only after Commit().

IndexWriterOptions

Settings for CreateWriter(IndexWriterOptions).

LogMergePolicy

Merges segments of similar size: segments are grouped into levels by document count (each level LevelLogSize times larger in log scale), and a level with at least MinSegments segments is merged into one. This is Tantivy's default policy.

MergePolicy

Decides when a writer merges segments in the background, after commits. Set it with MergePolicy. It isn't saved with the index: each writer uses its own.

MoreLikeThisOptions

How MoreLikeThis(Document, MoreLikeThisOptions?) picks terms from the example document. Null properties keep Tantivy's defaults.

MoreLikeThisQuery

A similar-documents match. Created by MoreLikeThis(Document, MoreLikeThisOptions?).

ParsedQuery

A query in Tantivy's query language. Created by Parse(string, QueryParserOptions).

PhraseQuery

A phrase match. Created by Phrase(string, string, int).

Query

A query built in code, passed to Search(Query, SearchOptions). Create one with the static factories (Term(string, string), Phrase(string, string, int), Fuzzy(string, string, int, bool, bool), Boolean(IEnumerable<Query>?, IEnumerable<Query>?, IEnumerable<Query>?), Range(string, long?, long?, bool, bool), Parse(string, QueryParserOptions), ...) and combine them with &, | and !.

QueryParseException

Thrown when a query string isn't valid Tantivy query syntax or references unknown fields.

QueryParserOptions

Settings for parsing query text with Parse(string, QueryParserOptions). Field names are checked when the query runs.

RangeQuery

A value-range match. Created by Range(string, long?, long?, bool, bool) and its overloads.

RegexQuery

A regular-expression term match. Created by Regex(string, string).

Schema

The immutable set of fields in an index. Build one with SchemaBuilder, or read an existing index's schema from Schema.

SchemaBuilder

Fluent builder for a Schema.

SearchHit

One search hit, from SearchResults.

SearchIndex

A Tantivy index, in memory or in a directory. Create documents with CreateWriter(IndexWriterOptions) and query them with CreateSearcher().

SearchOptions

Everything about a search besides the query: paging, ordering, returned fields, snippets, facet counts and aggregations. Pass it to Search(Query, SearchOptions).

SearchResults

The hits returned by Search(Query, SearchOptions), best first.

Searcher

Runs queries against a point-in-time snapshot of an index. Created by CreateSearcher().

SearcherLease

A searcher borrowed from a SearcherManager. Dispose it when done, typically with using; don't use Searcher afterwards.

SearcherManager

Shares one Searcher across requests and replaces it when the index changes, so requests don't each open a snapshot. Leases keep the searcher they got alive until disposed, even after it's replaced. Created by CreateSearcherManager(SearcherManagerOptions?).

SearcherManagerOptions

Settings for CreateSearcherManager(SearcherManagerOptions?).

SegmentStats

Statistics of one segment, in Segments.

Snippet

An excerpt of a field around the words that matched the query, with the matched words marked.

SnippetOptions

Asks Search(Query, SearchOptions) to compute a Snippet for each hit, for each of Fields.

SortBy

A sort key for OrderBy. Create one with Field(string, bool) or Score().

TantivyException

An error reported by the native Tantivy engine.

TermQuery

An exact-term match. Created by Term(string, string) and its overloads.

TermSetQuery

An any-of-these-terms match. Created by TermSet(string, IEnumerable<string>) and its overloads.

Enums

AnalyzerLanguage

A language for Stem(AnalyzerLanguage) and StopWords(AnalyzerLanguage).

DocStoreCompression

How stored fields (the doc store) are compressed. See DocStoreCompression.

FieldType

The value type of a schema field.

QueryOperator

How unprefixed terms of a parsed query are combined.

TantivyErrorCode

Categorizes errors reported by the native Tantivy engine.