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
namestringField name.
storedboolReturn the object in search hits.
fastboolAlso store values as fast fields (strings untokenized), for range queries, Exists(string) and aggregations on paths like
attrs.price.tokenizerstringThe tokenizer for string values; see AddTextField(string, bool, bool, string).