Skip to content

Working with Metadata and Object search

The Metadata and Object search can be used to search and analyze big volumes of objects quickly via a highly scalable text search. The search accepts filter parameters such as object name, location, created date, size and tags. Filters can be combined using "and" and "or" conditions.

The search results can be sorted by any one of the filter parameters and limited to maximum number of records per result set. If there are more results available than the defined maximum, a searchNext property is returned in the response. This property specifies the search request, which returns the remaining the results. It is included in every subsequent response, until the end of the list.

Get a list of metadata for an object - 'None' Operator

1
GET /api/dlsearch/v3/objectMetadata

Content-Type: application/json

Request Example:

1
2
3
4
5
6
7
{{gatewayUrl}}/api/dlsearch/v3/objectMetadata?filter={
      "none":{
      "name": {
      "contains": "sensor"
    }
  }
}

Response Example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{
  "objectMetadata": [
    {
      "name": "test1sensor.csv",
      "location": "Folder/test1sensor.csv",
      "size": 15,
      "created": "2018-10-01T09:21:36.559Z",
      "updated": "2018-10-03T09:21:36.559Z",
      "tags": [
        "tag1",
        "tag3"
      ],
      "metadataURL": "https://gateway.eu1-int.mindsphere.io/api/v3/dlstorage/objectMetadata/Folder1/test1sensor.csv"
    }
  ]
}

Get a list of metadata for an object - 'OR' Operator

1
GET /api/dlsearch/v3/objectMetadata

Content-Type: application/json

Request Example:

1
2
3
4
5
6
7
8
{{gatewayUrl}}/api/dlsearch/v3/objectMetadata?filter={
  "or":  {
    "name": { "contains": "sensor"},
    "created": {"after": "2018-10-24T11:42:53.983Z"},
    "size": { "eq":37},
    "tags":{ "in":["tag1","tag3"]}
  }
}&maxRecords=1

Response Example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
  "objectMetadata": [
    {
      "name": "test1sensor.csv",
      "location": "Folder/test1sensor.csv",
      "size": 15,
      "created": "2018-10-01T09:21:36.559Z",
      "updated": "2018-10-03T09:21:36.559Z",
      "tags": [
        "tag1",
        "tag3"
      ],
      "metadataURL": "https://gateway.eu1-int.mindsphere.io/api/v3/dlstorage/objectMetadata/Folder1/test1sensor.csv"
    }
  ],
  "sort": [
    {
      "field": "name",
      "order": "ASC"
    }
  ],
  "searchnext": [
    {
      "field": "name",
      "next": "test2sensor"
    },
    {
      "field": "_id",
      "next": "2222222"
    }
  ]
}

Get a list of metadata for an object - 'AND' Operator

1
GET /api/dlsearch/v3/objectMetadata

Content-Type: application/json

Request Example:

1
2
3
4
5
6
7
8
{{gatewayUrl}}/api/dlsearch/v3/objectMetadata?filter={
    "and":  {
    "name": { "contains": "sensor"},
    "created": {"after": "2018-10-24T11:42:53.983Z"},
    "size": { "eq":37},
    "tags":{ "in":["tag1","tag3"]}
  }
}

Response Example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{
  "objectMetadata": [
    {
      "name": "test1sensor.csv",
      "location": "Folder/test1sensor.csv",
      "size": 15,
      "created": "2018-10-01T09:21:36.559Z",
      "updated": "2018-10-03T09:21:36.559Z",
      "tags": [
        "tag1",
        "tag3"
      ],
      "metadataURL": "https://gateway.eu1-int.mindsphere.io/api/v3/dlstorage/objectMetadata/Folder1/test1sensor.csv"
    }
  ]
}

Any questions left?

Ask the community


Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.