Table of Contents

Method AddJsonField

Namespace
TantivyDotNet
Assembly
TantivyDotNet.dll

AddJsonField(string, bool, bool, string)

Adds a JSON field: each document can put any JSON object in it, without declaring the keys. Query a key by its path: Query.Term("attrs.color", "red"), Query.Range("attrs.size", 2L, 5L), or attrs.color:red in parsed queries. Strings are tokenized with tokenizer; numbers, booleans and RFC 3339 dates keep their type.

public SchemaBuilder AddJsonField(string name, bool stored = false, bool fast = false, string tokenizer = "default")

Parameters

name string

Field name.

stored bool

Return the object in search hits.

fast bool

Also store values as fast fields (strings untokenized), for range queries, Exists(string) and aggregations on paths like attrs.price.

tokenizer string

The tokenizer for string values; see AddTextField(string, bool, bool, string).

Returns

SchemaBuilder