Table of contents

Scroll API

Overview

To search the metadata in the GrayMeta Platform, and get over 10k items in response, make the following request:

POST /api/data/scroll
{
	"query": {query},
}
  • query (string) - The text to search for - See the Full text search documentation for examples

Search response

A typical search query response looks like this:

{
{
  "query": {query},
  "limit": {limit},
  "page": {page},
  "types": {types},
  "fields": {fields},
  "sort_fields": {sort_fields},
  "only": {only},
  "filters": {
    "terms": {terms},
    "match_phrase": {match_phrase},
    "exclude_terms": {exclude_terms},
    "multi_terms": {multi_terms},
    "ranges": {ranges},
    "exists": {exists},
    "not_exists": {not_exists}
  },
  "disable_aggr": {disable_aggr},
  "total_hits": <number of results>,
  "results": [
    {
            "result": {
                "_id": "b44698697fc7de5725d1e1fe22d38e32",
                "last_modified": "2016-07-20T21:21:09Z",
                "location_id": "AVbdTJJcuT9aoTJxqbUD",
                "location_kind": "azure",
                "location_name": "Demo Content",
                "mime_type": "audio/x-wav",
                "name": "Annie and Brie/Raw Audio/AB3-1C_2561.wav",
                "stow_container_id": "annie-and-brie",
                "stow_container_name": "annie-and-brie",
                "stow_url": "azure://democontent.blob.core.windows.net/annie-and-brie/Annie%20and%20Brie/Raw%20Audio/AB3-1C_2561.wav"
            },
            "highlight": [
								{"field": "title", "fragments": ["example <em>query</em>"] },
								{"field": "otherfield", "fragments": ["another text <em>highlight here</em>"] }
            ],
            "score": 0.93453264
        }
	],
	"filters": {},
	"aggregations": {}
}

query, limit and page repeat the input values that yielded the results.

  • total_hits (int) Approximate number of total hits for the given search
  • results - (array) Array of result objects (see Result fields section below)
  • highlight - (object) An object containing HTML indicating why an item was matched (see Highlights fields section below)
  • score - (int) A decimal percentage value of how relevant this item is to the search query (0 being not relevant, 1 being most relevant; low numbers are common)
  • filters - (object) Object describing the filters that were applied in the search request
  • aggregations - (object) The aggregation results

Some examples for setting time ranges as a filter:

   "filters":{
      "ranges":[
         {
            "field":"last_harvested",
            "from":"now-1h",
            "to":""
         }
      ]
   "filters":{
      "ranges":[
         {
            "field":"last_harvested",
            "from":"2017-12-31T19:30:000.000Z",
            "to":"2017-12-31T19:45:00.000Z"
         }
      ]

Result fields

The result objects contain an overview of Item Object metadata.

  • _id - (string) Unique Item ID
  • last_modified - (timestamp) When the item was last modified
  • location_id - (string) The ID of the Location where this Item was found
  • location_kind - (string) The Location Kind (see the Location Kinds API for more information) of the Location where this Item was found
  • mime_type - (string) MIME type for the item
  • name - (string) Name of the item (usually filename)
  • stow_container_id - (string) Stow Container ID of where this Item was found
  • stow_container_name - (string) Name of the Stow Container where this Item was found
  • stow_url - (string) The Stow URL of this Item.

This documentation is generated from the latest version of GrayMeta Platform. For documentation relevant to your own deployed version, please use the documentation inside the application.