Json Path Query
A JSONPath search (SPEC.md §10.4): the nodes path selects from the documents of the store. Hits are the distinct selected nodes in (docId, nodePre) order, ascending or descending by order — each node once, unlike an RFC 9535 nodelist, which JsonStore.select gives for one value.
mode: ResultMode.CONTAINING_ELEMENT (the default) makes each selected node a hit; ResultMode.WHOLE_DOCUMENT each document where the query selects at least one node, with the root as the hit's node.
nested: with NestedHits.OUTERMOST_ONLY, a selected node inside another selected node of the same document is dropped.
limit, maxBytes, after: pagination, as in KeyValueQuery.
type: only selected objects of this type are hits. A search with an invalid name throws InvalidTypeNameException.
scan: what to do when the index can't narrow the search down (see JsonStore.explain).
order: the order of the hits, as in KeyValueQuery.
documentFilter: only the documents it accepts are searched; set with withDocumentFilter.
maxDocuments: the result ends after the hits of this many documents; set with withMaxDocuments.
Queries are values: two instances with the same settings are equal, and copy derives a variant.
Constructors
A search of the documents documentFilter accepts, or of every document when it is null.
A search of every document.
Properties
The condition a document has to meet to be searched (SPEC.md §10.5), or null to search every document. A comparison of one of its root's members with a literal is an index term the search requires, as one in path is: a query whose path alone would need a scan doesn't when the filter names such a term.
How many documents with hits the result covers, or null for no bound (SPEC.md §4.6): the result ends after the hits of that many documents, in order, and the search reads no further document. withMaxDocuments(1) in SearchOrder.DESCENDING is every hit of the newest document that has one.
Functions
This query with the given settings changed, the documentFilter and maxDocuments kept; the result is validated like a new instance.
This query with documentFilter set to filter, or removed with null.
This query with maxDocuments set to n, or removed with null; n must be positive.