The search token must cover the index you are querying. See Minting search tokens.
Search parameters
An empty
q is valid. Sending only a filter, or neither, returns documents in ranking order, which is what you want for browsing views and filter-driven pickers.
Filter expressions
A filter names a filterable attribute, an operator, and a value. Only attributes marked filterable on the index can be used. See Discovery indexes for how to find them.
Combine expressions with
AND and OR, and group them with parentheses:
filter also accepts an array. Elements of the outer array are combined with AND, and elements of a nested array are combined with OR. These two are equivalent:
Discovery rejects a filter on an attribute that is not filterable with a
400. This is the opposite of the Omneo API list endpoints, which silently ignore an unrecognised filter attribute. A typo in a Discovery filter fails loudly.Sorting
sort takes an array of attribute:direction strings, applied in order. The attribute must be sortable on the index.
sort, hits come back in relevance order for the given q.
Pagination
Two modes are available, and the response shape differs between them.
Use offset pagination for infinite scroll and typeahead, where an approximate total is fine and later pages are rarely reached. Use page pagination when you need to render exact page numbers or a total count, which costs a little more to compute.
Facets
Requestfacets to get the distinct values of an attribute and how many documents carry each one. This is how you populate filter menus, and how you discover what values an attribute can hold.
facetDistribution:
q and filter, so they narrow as the user refines the search. Only filterable attributes can be requested as facets.
Response shape
hits holds the matching documents, each shaped by that index’s attributes. processingTimeMs is the search time on the Discovery host and excludes network time. estimatedTotalHits is an approximation that improves as more of the result set is scanned, so treat it as a “roughly this many” figure rather than an exact count. Use page pagination when you need an exact totalHits.
Searching several indexes at once
Post to/multi-search to run queries against different indexes in a single round trip, for example a combined profile and product search behind one search box.
results array, one entry per query, each in the shape above with its indexUid included. The search token must cover every index named in queries.
curl example
JavaScript example
401 or 403.