UmweltDocs
Reference/Queries/search
searchquerysince 0.1

Finds Facts, Holdings with text and events by their words, their meaning or both, within what the read can see.

Request
umwelt call story.umw search '{
  "projectId": "ball",
  "text": "roses",
  "filter": { "holder": "bob" }
}'
Request
const result = await client.search({ projectId: 'ball', text: 'roses', filter: { holder: 'bob' } });
Request
var result = engine.Search(new SearchPayload
{
    ProjectId = "ball",
    Text = "roses",
    Filter = new SearchFilter { Holder = "bob" },
});
Response
{
  "items": [
    {
      "docId": "bob-hid",
      "docType": "record",
      "match": "text",
      "record": {
        "kind": "holding",
        "id": "bob-hid",
        "projectId": "ball",
        "timelineId": "main",
        "eventId": "garden",
        "holder": "bob",
        "claim": {
          "subject": "necklace",
          "predicate": "hidden-in",
          "object": { "kind": "entity", "id": "garden" },
          "polarity": true,
          "qualifiers": {}
        },
        "attitude": "knows",
        "confidence": 1.0,
        "accessibility": "available",
        "acquisition": { "kind": "witnessed", "eventId": "garden" },
        "position": { "tick": 2 },
        "provenance": { "origin": { "kind": "human" } },
        "recordedAt": 3,
        "secrecy": { "sharedWith": [] },
        "text": "I buried the necklace under the roses."
      }
    }
  ]
}

Payload

FieldTypeDescription
projectIdrequiredstringThe project to read.
textstringWords to find. At least one of text and semantic is required; with both, the search is hybrid.
semanticSearchSemanticA query vector from your model, and the spaceId it belongs to.
atAtdefault {}Where to read: tick, an optional axis, and asOfVersion. Defaults to the latest.
filterSearchFilterdefault {}holder: only that holder’s active, available Holdings. docType: record or event.
pagePagedefault {"limit":100}How many items to return (limit, 1 to 1000) and where to continue (cursor, the nextCursor of the previous page).
timelineIdstringdefault "main"The timeline to read.

Result

FieldTypeDescription
itemsalwaysSearchItem[]Matches, best first, each with its docType, docId, the record or event, match (text, semantic or both) and, by meaning, its score.
nextCursorstringMore matches follow.

Rules

A match the read cannot see is never returned. The timeline, the position, the status of each record and, with filter.holder, the holder’s own perspective all apply, however well a document matches.

Without a holder, the narrator’s view. Facts and events. Suppressed and inaccessible Holdings are never returned.

Pages can shift. The cursor is an offset: keep the file unchanged while paging, or start again after a write.

Errors

VALIDATION_FAILEDNeither text nor semantic is given, a semantic page reads past 1,000 results, or the vector does not fit the space.
NOT_FOUNDThe project, timeline or embedding space does not exist, or the draft read was purged.
INVALID_STATEThe timeline read is a draft that was promoted. details.promotedInto names the timeline to read instead.
HANDSHAKE_REQUIREDOver the protocol, hello was not sent first.

Every code is listed in Errors.

See also

Was this page helpful?