Search

3 個端點 · 概覽

GET/v1/facets

What a search can filter, count and sort by, named, and names for the sidecar namespaces (the library's tabs)
Bearer 權杖

參數 · 查詢

  • spacesstring
    Comma-separated space ids; default every space of the caller

回應

  • 200
    Fields and namespaces
    object
    › 顯示欄位
    • fieldsFacetDef[]必填
      The index's own (kind, duration_ms, has, state, language, captured_at, saved_at, width, height, space), built-in, plugin and the workspaces' own, by position
      › 10 個欄位
      • idstring必填
      • workspace_idstring
        Set for a workspace's own fields
      • keystring必填
        The filter key: tags, shot, f.client
      • originstring必填
        builtinplugincustom
      • namespacestring必填
        The sidecar the values are in (custom fields: fields)
      • pathstring必填
      • typestring必填
        keywordkeywordsenumnumberdatebool
      • optionsobject
        {"values": [...]} for an enum; {"unit": "…"} for a number
      • labelmap<string, string>必填
      • positioninteger必填
    • namespacesobject[]必填
      › 3 個欄位
      • namespacestring必填
      • originstring必填
        other: no name known; label is the namespace
        builtinpluginother
      • labelmap<string, string>必填
  • 4xx/5xx
    Error
    Error
請求範例
curl "https://side.space/v1/facets" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN"
回應範例 · 200
{
  "fields": [
    {
      "id": "id",
      "workspace_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
      "key": "key",
      "origin": "builtin",
      "namespace": "x-acme.qc",
      "path": "Ep01/Shots/A001_C003.mov",
      "type": "keyword",
      "options": {},
      "label": {
        "key": "string"
      },
      "position": 1
    }
  ],
  "namespaces": [
    {
      "namespace": "x-acme.qc",
      "origin": "builtin",
      "label": {
        "key": "string"
      }
    }
  ]
}

POST/v1/search

Search with filters, grouping by moment, sorting, pages, counts and coverage
Bearer 權杖

Searches the index the server builds from sidecars (library-and-search.md 3.2, 4.1). With q, every word must match somewhere, as in GET /v1/search; without q, it lists what the filters let through. Filters are ANDed, the values of one filter ORed (any), all required (all) or excluded (none). Keys: kind (video, audio, image, document, other, folder), has (namespaces present, "ai." dropped: transcript, tags, media…), language, state (none, waiting, running, done, failed), space, duration_ms, width, height, captured_at, saved_at (Unix ms or RFC 3339), and the fields of facet_defs (tags, rating, label, status, shot_type, people, speakers, video_codec, source.site, …). Relevance lists word hits best field first, newer first within one; files only close in meaning follow, each with a score (never mixed into the word ranking). With group moment each hit is one moment that holds a word (every moment of matching files without q), a file's moments together and in time order. The answer's next is the cursor of the next page.

請求內文SearchQuery application/json

  • qstring
    Words (up to 8). Empty: list what the filters let through
  • scopeobject
    › 3 個欄位
    • spacesstring[]
      Spaces (member only); default every space of the caller
      ≤ 100 items
    • folderstring
      Only under this folder path ("/Ep03/素材"); needs exactly one space
    • depthinteger
      1: only what is directly in the folder (or the spaces' roots), not in its subfolders
      01
      default 0
  • filtersSearchFilter[]
    A filter on a field the server does not know is left out and named in ignored
    › 8 個欄位
    • keystring必填
    • isany
      A value (string
    • anyany[]
    • allany[]
    • noneany[]
    • gteany
      Lower bound: a number, or an RFC 3339 time for dates
    • lteany
      Upper bound
    • existsboolean
  • groupstring
    filemoment
    default "file"
  • sortstring
    Default relevance with q, saved_at without. saved_at, captured_at, size, duration, width, height: largest first; name, kind, language: A to Z; or a field's key (GET /v1/facets): a keyword field by its first value, A to Z; a number or date, largest first. Empty values last. An unknown field is left out (ignored)
  • orderstring
    Turns the sort (not relevance). Default: the sort's own
    ascdesc
  • modestring
    autokeywordmeaning
    default "auto"
  • vectorsmap<string, string (byte)>
    Query vectors by model id, computed by the client (the Mac's Search by Meaning), the query prefix of the model's contract applied: base64 of little-endian float32 or float16, the model's whole output or its first dim numbers (ADR 0061). Each space is searched with its workspace's model: with this vector, or else the server's own encoding of q (SIDESPACE_EMBED_URL with that model), or by words only (meaning says why). Word hits come first, then files (or, with group moment, moments) found by meaning alone, with score; filters apply to them and total and counts include them
  • countsstring[]
    Fields to count over the hits (each filter but the field's own applies). Keyword fields by value; number and date fields by range: value is {gte, lt} (either may be missing). Durations: under 1 min, 1–5, 5–20, 20–60, over 60; dates: older than a year, the last year, month, week, day; other numbers by each whole value when few, else five equal steps. Every range is listed
    ≤ 12 items
  • cursorstring
  • limitinteger
    default 60 · ≥ 1 · ≤ 200

回應

請求範例
curl -X POST "https://side.space/v1/search" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"q":"harbor night","scope":{"spaces":["space"],"folder":"folder","depth":"0"},"filters":[{}]}'
回應範例 · 200
{
  "hits": [
    {}
  ],
  "counts": {
    "key": [
      {}
    ]
  },
  "coverage": {
    "total": 1,
    "indexed": 1,
    "waiting": 1,
    "failed": 1,
    "meaning": 1
  },
  "meaning": {
    "state": "used",
    "model": "model",
    "query": "client",
    "reason": "no_query_vector",
    "next": "next"
  },
  "next": "next",
  "total": 1,
  "total_capped": false,
  "ignored": [
    {
      "kind": "filter",
      "key": "key",
      "reason": "reason"
    }
  ]
}