Searching
Everything a search interface does — text, paging, filters, facets, tabs, autocomplete and the language features on top.
One call does the searching: client.api.query.search(query). The pages here are about everything you build
around it.
const result = await client.api.query.search({
name: "<your-query>",
text: "quarterly report",
pageSize: 10,
});Documents come back in records, facet counts in aggregations — one request, both answers. That is the single
most useful thing to know before reading further.
The interface, piece by piece
Text and paging
The search box and the pager, including how to read pagination back without arithmetic.
Query syntax
What a user can type: exact phrases, concepts, exclusions, patterns.
Filtering results
Turning facet clicks, checkboxes and date ranges into a query's filters.
Aggregations
Rendering facets, loading more items, expanding tree facets.
Tabs, scopes and sorting
The three server-configured selectors, and why you should not hardcode their options.
Autocomplete
Search-as-you-type suggestions, and cancelling the ones the user outran.
Beyond keyword search
Language features
Answers, passages, spelling correction, query analysis and query intents.
Datasets
Named, parameterised queries for dashboards — and running several searches in one request.
URL state
Making a search shareable and navigable through the address bar.
Export
Handing the user a CSV or XLSX of a result set.