Creation Options
The options a store is created with, fixed for its whole life: they shape the stored data and the index terms. They are given to JsonStore.create and JsonStore.openOrCreate, recorded in the store, and read back by JsonStore.open, so opening a store never needs them; JsonStore.creationOptions tells what a store was created with. The options that may differ at every open are StoreOptions.
| Option | Default | Range |
|---|---|---|
| fragmentBytes | 64 KiB | 32 B … 16 MiB |
| hashTerms | true | |
| indexedKeys | empty (every key) | |
| excludedKeys | empty | disjoint from indexedKeys |
| minIndexedStringBytes | 0 | ≥ 0 |
| maxIndexedStringBytes | unlimited | ≥ minIndexedStringBytes |
| normalization | Normalization.NONE | |
| documentKey | none | a JSON path other than $ |
Options are values: two instances with the same settings are equal, and copy derives a variant, such as CreationOptions().copy(normalization = Normalization.NFC).
fragmentBytes: target size T of the fragments a document is split into (SPEC.md §1). Values below 4 KiB are for testing. It also sets two limits (SPEC.md §1.3): a key is at most
max(T/4, 64)UTF-8 bytes, and a number at mostmin(4096, max(T/4, 64))characters, so a larger T allows longer keys and, up to a T of 16 KiB, longer numbers.hashTerms: index whole object and array values, which searches for object and array literals need.
indexedKeys: when not empty, only members with these keys are indexed; excludedKeys: keys never indexed.
minIndexedStringBytes, maxIndexedStringBytes: UTF-8 lengths of the string values that are indexed. Numbers, booleans and null are always indexed. A search the controls leave unanswerable is rejected (SPEC.md §4.6); documents are stored and read back in full either way.
normalization: whether strings and keys are normalized to NFC as they are read (SPEC.md §2.1). With Normalization.NFC the normalized form is what is stored, indexed, compared and read back, and query keys, query values, type names and type paths are normalized the same way.
documentKey: the JSON path of the string that names each document (SPEC.md §3.3), set with withDocumentKey.
Constructors
Options without a documentKey.
Options with a documentKey; validated like the others.
Properties
The JSON path of the string member that names each document, or null for a store without document keys (SPEC.md §3.3): an RFC 9535 singular query without negative indexes, such as $.id or $['meta']['key'], as type paths are (SPEC.md §6.1), and not $ itself.
Functions
These options with the given ones changed, the documentKey kept; the result is validated like a new instance.
These options with documentKey set to path, or removed with null. Throws InvalidJsonPathException when path isn't a JSON path that can name a document's key.