Key Value Query
A key–value search (SPEC.md §4): objects with a member key whose value, or an element of whose array value, equals value.
mode: ResultMode.WHOLE_DOCUMENT (the default) makes each matching document a hit, with the root as the hit's node; ResultMode.CONTAINING_ELEMENT each object that contains a match.
nested: with NestedHits.OUTERMOST_ONLY, a containing object inside another containing object of the same document is dropped.
limit: at most this many hits per page.
maxBytes: a page also ends before a hit that would take the sum of the page's SearchHit.encodedSizes above this; a page always holds at least one hit. Long.MAX_VALUE means no byte budget.
after: resume strictly past this cursor's
(docId, nodePre)in order. A cursor from a search of the other order, or from a TypePage, is refused with InvalidCursorException.type: only containing objects of this type match (SPEC.md §6.2); in WHOLE_DOCUMENT mode a document is a hit when one of its objects of this type contains a match. A search with an invalid name throws InvalidTypeNameException.
order: the order of the hits (SPEC.md §4.4). SearchOrder.DESCENDING with
limit = 1gives the newest hit.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 every document for objects whose member key has value.
Properties
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, maxDocuments kept; the result is validated like a new instance.
This query with maxDocuments set to n, or removed with null; n must be positive.