Search
One word finds the records that carry it — every kind at once, grouped by kind, and only the kinds your key may read. This guide is the typeahead, the exact lane for codes, the question lane for anything longer, and one first call to copy.
The typeahead
searchAll takes one word — a prefix of at least 2 characters, folded so that case and accents do not matter — and answers a page grouped by kind, the kinds in the searchable order. Each hit carries the record's id, its reference, its caption, its status and the token the prefix matched: a word of the caption, the reference itself, or the record's own code. A space in the prefix is refused. Search one word, then narrow on your side: match your further words against the captions that came back.
The page is bounded. Ask for at most 50 hits with first; leave it out and you get 20. When the page was cut, more is true. There is no cursor — narrow the word, or ask one kind for its own list. Only the kinds your key may read ever answer: a kind you cannot read is left out before the page is cut, never refused by name.
When you already know the kind, search asks that one kind for the captions that begin with your prefix.
The exact lane
A code is not a word. resolveIdentifier takes a kind — one of sku, plu, gtin:upc-a, gtin:ean-13 and gtin:itf-14 — and a value, and answers every variant that has carried that identifier, newest first, each with a current flag: true while the assignment stands, false once it was superseded. A PLU or a GTIN belongs to one organization, so organizationId is required for those kinds; a SKU is one across your organization group, so organizationId is refused for it.
The question lane
A question is not a typeahead. "Open orders for Acme last week" is a planned scan over records and their relationships: draftSearchPlan turns the words into a plan you can read, then searchPlanRun runs it while you wait, or startSearchJob runs it in the background and keeps the results for a while. The reference has the detail; reach for this lane when a word is not enough.
Your first search
Example request
query ExampleSearchAll($prefix: String!, $first: Int) {
searchAll(prefix: $prefix, first: $first) {
more
}
}
Variables:
{
"prefix": "<prefix>",
"first": 1
}
Example response
{
"data": {
"searchAll": {
"more": true
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
The office's search box and the command line's search-all are this same operation — one index, one answer, one door.