Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Search

Datasets can be searched for within their containing workspace. Searches can filter datasets by arbitrary text, channel name, or tag name.

See here for more information on constructing a search filter query.


Requests


Search for datasets in a workspace by free text

GET

/api/workspaces/{workspaces-id}/search?q={free-text}

Searches the workspace {workspace-id} for datasets by the free text {free-text}.

Prerequisites

  • Workspace {workspace-id} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.matatika.com/api/workspaces/8639773d-6b49-40e6-b7f0-4ee2857bfa6e/search?q=data%20warehouse' -i -X GET \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'

Python (requests)

import requests

url = "https://app.matatika.com/api/workspaces/8639773d-6b49-40e6-b7f0-4ee2857bfa6e/search?q=data%20warehouse"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

{
  "_embedded" : {
    "datasets" : [ {
      "id" : "912828e6-8b5d-4945-a410-4bccea444747",
      "published" : "2024-12-16T09:58:32.678061",
      "alias" : "analytics-tables",
      "workspaceId" : "8639773d-6b49-40e6-b7f0-4ee2857bfa6e",
      "source" : "no-picture",
      "title" : "What tables are in our #fantastic data warehouse?",
      "description" : "# Overview\nThis example is a standalone data set with no visualisation.\n\n## What tables are in my data warehouse\nOur query in this dataset selects all the tables in the same schema we have configured the workspace to use.\n```SHOW TABLES```\n\n## Notes\nThe query is database specific.  The #postgres query is\n\n```SELECT * FROM pg_tables where schemaname = 'lyfzgor'```",
      "visualisation" : "{\"google-chart\": {\"chartType\": \"Table\", \"options\": {\"title\": \"Tables\"}}}",
      "metadata" : "  {    \"name\":\"table_model\",    \"label\":\"Analytics Tables\",    \"related_table\":{      \"columns\":[        {          \"name\":\"schemaname\",          \"label\":\"Schema Name\"        }      ]    }  }",
      "query" : "SELECT schemaname \"table_model.schemaname\",tablename \"table_model.tablename\",tableowner \"table_model.tableowner\"FROM pg_tables where schemaname = 'lyfzgor'",
      "likeCount" : 0,
      "likedByProfiles" : [ ],
      "commentCount" : 0,
      "viewCount" : 0,
      "created" : "2024-12-16T09:58:32.678061",
      "score" : 20.510712,
      "_links" : {
        "self" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747"
        },
        "delete dataset" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747",
          "type" : "DELETE"
        },
        "edit dataset" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747",
          "type" : "PATCH"
        },
        "data" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747/data",
          "type" : "GET"
        },
        "source" : {
          "href" : "https://app.matatika.com/api/channels/73d145f4-609b-4fd8-8d0f-f176be1ac4bb",
          "type" : "GET"
        },
        "new comment" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747/comments",
          "type" : "POST"
        },
        "add like" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747/like",
          "type" : "PUT"
        },
        "add view" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747/view",
          "type" : "PUT"
        },
        "new alert" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747/alerts"
        },
        "add subscription" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747/subscriptions"
        },
        "new message" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747/messages"
        }
      },
      "_embedded" : {
        "source" : {
          "name" : "no-picture",
          "description" : "No picture",
          "picture" : "https://s.gravatar.com/avatar/8f4ad8fa0793181b761d030196e62053?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fsu.png"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://app.matatika.com/api/workspaces/8639773d-6b49-40e6-b7f0-4ee2857bfa6e/search?q=data%20warehouse&page=0&size=20"
    }
  },
  "page" : {
    "size" : 20,
    "totalElements" : 1,
    "totalPages" : 1,
    "number" : 0
  }
}

204 No Content

No response body provided.


Search for datasets in a workspace by channel name

GET

/api/workspaces/{workspaces-id}/search?q=in:{channel-name}

Searches the workspace {workspace-id} for datasets by the channel {channel-name}.

Prerequisites

  • Workspace {workspace-id} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.matatika.com/api/workspaces/8639773d-6b49-40e6-b7f0-4ee2857bfa6e/search?q=in%3Amatatika-limited%20' -i -X GET \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'

Python (requests)

import requests

url = "https://app.matatika.com/api/workspaces/8639773d-6b49-40e6-b7f0-4ee2857bfa6e/search?q=in%3Amatatika-limited%20"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

Dataset collection with HAL links.

{
  "_embedded" : {
    "datasets" : [ {
      "id" : "a5be5cb5-b943-4a36-bd8b-178bbda0292c",
      "published" : "2024-12-16T09:58:32.678972",
      "alias" : "simple-bar-chart",
      "workspaceId" : "8639773d-6b49-40e6-b7f0-4ee2857bfa6e",
      "source" : "matatika-limited",
      "title" : "How many people have visited our website?",
      "description" : "# Some Markdown\n- point 1\n- point 2\n- point 3\n",
      "questions" : "[''This is my question'', ''this is second question'']",
      "visualisation" : "{\"google-chart\": {\"chartType\": \"BarChart\",\"options\": {\"title\": \"Website visitors\"}}}",
      "query" : "SELECT to_char(date(report_date),'YYYYMM') as year_month, SUM(sessions) \n   FROM\n     \"google_analytics_website_overview\"\n   WHERE\n     \"google_analytics_website_overview\".\"report_date\" >= DATE(NOW()) - INTERVAL '365 DAY'\n   GROUP BY year_month\n   ORDER BY year_month ASC;",
      "likeCount" : 0,
      "likedByProfiles" : [ ],
      "commentCount" : 0,
      "viewCount" : 0,
      "created" : "2024-12-16T09:58:32.678971",
      "score" : 18.531616,
      "_links" : {
        "self" : {
          "href" : "https://app.matatika.com/api/datasets/a5be5cb5-b943-4a36-bd8b-178bbda0292c"
        },
        "delete dataset" : {
          "href" : "https://app.matatika.com/api/datasets/a5be5cb5-b943-4a36-bd8b-178bbda0292c",
          "type" : "DELETE"
        },
        "edit dataset" : {
          "href" : "https://app.matatika.com/api/datasets/a5be5cb5-b943-4a36-bd8b-178bbda0292c",
          "type" : "PATCH"
        },
        "data" : {
          "href" : "https://app.matatika.com/api/datasets/a5be5cb5-b943-4a36-bd8b-178bbda0292c/data",
          "type" : "GET"
        },
        "source" : {
          "href" : "https://app.matatika.com/api/channels/6efc25b5-320c-41fb-849c-fc2ebd82b163",
          "type" : "GET"
        },
        "new comment" : {
          "href" : "https://app.matatika.com/api/datasets/a5be5cb5-b943-4a36-bd8b-178bbda0292c/comments",
          "type" : "POST"
        },
        "add like" : {
          "href" : "https://app.matatika.com/api/datasets/a5be5cb5-b943-4a36-bd8b-178bbda0292c/like",
          "type" : "PUT"
        },
        "add view" : {
          "href" : "https://app.matatika.com/api/datasets/a5be5cb5-b943-4a36-bd8b-178bbda0292c/view",
          "type" : "PUT"
        },
        "new alert" : {
          "href" : "https://app.matatika.com/api/datasets/a5be5cb5-b943-4a36-bd8b-178bbda0292c/alerts"
        },
        "add subscription" : {
          "href" : "https://app.matatika.com/api/datasets/a5be5cb5-b943-4a36-bd8b-178bbda0292c/subscriptions"
        },
        "new message" : {
          "href" : "https://app.matatika.com/api/datasets/a5be5cb5-b943-4a36-bd8b-178bbda0292c/messages"
        }
      },
      "_embedded" : {
        "source" : {
          "name" : "matatika-limited",
          "description" : "Matatika Limited",
          "picture" : "https://cdn.auth0.com/avatars/ml.png?ssl=1"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://app.matatika.com/api/workspaces/8639773d-6b49-40e6-b7f0-4ee2857bfa6e/search?q=in%3Amatatika-limited%20&page=0&size=20"
    }
  },
  "page" : {
    "size" : 20,
    "totalElements" : 1,
    "totalPages" : 1,
    "number" : 0
  }
}

204 No Content

No response body provided.


Search for datasets in a workspace by tag name

GET

/api/workspaces/{workspace-id}/search?q=tag:{tag-name}

Searches the workspace {workspace-id} for datasets by the tag {tag-name}.

Prerequisites

  • Workspace {workspace-id} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.matatika.com/api/workspaces/8639773d-6b49-40e6-b7f0-4ee2857bfa6e/search?q=tag%3Apostgres' -i -X GET \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'

Python (requests)

import requests

url = "https://app.matatika.com/api/workspaces/8639773d-6b49-40e6-b7f0-4ee2857bfa6e/search?q=tag%3Apostgres"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

{
  "_embedded" : {
    "datasets" : [ {
      "id" : "912828e6-8b5d-4945-a410-4bccea444747",
      "published" : "2024-12-16T09:58:32.678061",
      "alias" : "analytics-tables",
      "workspaceId" : "8639773d-6b49-40e6-b7f0-4ee2857bfa6e",
      "source" : "no-picture",
      "title" : "What tables are in our #fantastic data warehouse?",
      "description" : "# Overview\nThis example is a standalone data set with no visualisation.\n\n## What tables are in my data warehouse\nOur query in this dataset selects all the tables in the same schema we have configured the workspace to use.\n```SHOW TABLES```\n\n## Notes\nThe query is database specific.  The #postgres query is\n\n```SELECT * FROM pg_tables where schemaname = 'lyfzgor'```",
      "visualisation" : "{\"google-chart\": {\"chartType\": \"Table\", \"options\": {\"title\": \"Tables\"}}}",
      "metadata" : "  {    \"name\":\"table_model\",    \"label\":\"Analytics Tables\",    \"related_table\":{      \"columns\":[        {          \"name\":\"schemaname\",          \"label\":\"Schema Name\"        }      ]    }  }",
      "query" : "SELECT schemaname \"table_model.schemaname\",tablename \"table_model.tablename\",tableowner \"table_model.tableowner\"FROM pg_tables where schemaname = 'lyfzgor'",
      "likeCount" : 0,
      "likedByProfiles" : [ ],
      "commentCount" : 0,
      "viewCount" : 0,
      "created" : "2024-12-16T09:58:32.678061",
      "score" : 9.559701,
      "_links" : {
        "self" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747"
        },
        "delete dataset" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747",
          "type" : "DELETE"
        },
        "edit dataset" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747",
          "type" : "PATCH"
        },
        "data" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747/data",
          "type" : "GET"
        },
        "source" : {
          "href" : "https://app.matatika.com/api/channels/6704fd8d-2ec9-45d7-8810-1993f6522168",
          "type" : "GET"
        },
        "new comment" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747/comments",
          "type" : "POST"
        },
        "add like" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747/like",
          "type" : "PUT"
        },
        "add view" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747/view",
          "type" : "PUT"
        },
        "new alert" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747/alerts"
        },
        "add subscription" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747/subscriptions"
        },
        "new message" : {
          "href" : "https://app.matatika.com/api/datasets/912828e6-8b5d-4945-a410-4bccea444747/messages"
        }
      },
      "_embedded" : {
        "source" : {
          "name" : "no-picture",
          "description" : "No picture",
          "picture" : "https://s.gravatar.com/avatar/8f4ad8fa0793181b761d030196e62053?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fsu.png"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://app.matatika.com/api/workspaces/8639773d-6b49-40e6-b7f0-4ee2857bfa6e/search?q=tag%3Apostgres&page=0&size=20"
    }
  },
  "page" : {
    "size" : 20,
    "totalElements" : 1,
    "totalPages" : 1,
    "number" : 0
  }
}

204 No Content

No response body provided.


Search for datasets in a workspace using msearch

POST

/api/workspaces/{workspace-id}/datasets/_msearch

Searches the workspace {workspace-id} for datasets using an elastic search query.

Prerequisites

  • Workspace {workspace-id} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://app.matatika.com/api/workspaces/8639773d-6b49-40e6-b7f0-4ee2857bfa6e/datasets/_msearch' -i -X POST \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: text/plain; charset=ISO-8859-1' \
    -d '{"preference":"search"}
{
   "query":{
      "bool":{
         "must":[
            {
               "bool":{
                  "must":{
                     "bool":{
                        "should":[
                           {
                              "multi_match":{
                                 "query":"data warehouse",
                                 "fields":[
                                    "title"
                                 ],
                                 "type":"cross_fields",
                                 "operator":"and"
                              }
                           },
                           {
                              "multi_match":{
                                 "query":"data warehouse",
                                 "fields":[
                                    "title"
                                 ],
                                 "type":"phrase",
                                 "operator":"and"
                              }
                           },
                           {
                              "multi_match":{
                                 "query":"data warehouse",
                                 "fields":[
                                    "title"
                                 ],
                                 "type":"phrase_prefix",
                                 "operator":"and"
                              }
                           }
                        ],
                        "minimum_should_match":"1"
                     }
                  }
               }
            }
         ]
      }
   },
   "highlight":{
      "pre_tags":[
         "<mark>"
      ],
      "post_tags":[
         "</mark>"
      ],
      "fields":{
         "title":{
            
         }
      },
      "require_field_match":false
   },
   "size":10,
   "_source":{
      "includes":[
         "*"
      ],
      "excludes":[
         
      ]
   }
}'

Python (requests)

import requests

url = "https://app.matatika.com/api/workspaces/8639773d-6b49-40e6-b7f0-4ee2857bfa6e/datasets/_msearch"

data = {"preference":"search"}
{
   "query":{
      "bool":{
         "must":[
            {
               "bool":{
                  "must":{
                     "bool":{
                        "should":[
                           {
                              "multi_match":{
                                 "query":"data warehouse",
                                 "fields":[
                                    "title"
                                 ],
                                 "type":"cross_fields",
                                 "operator":"and"
                              }
                           },
                           {
                              "multi_match":{
                                 "query":"data warehouse",
                                 "fields":[
                                    "title"
                                 ],
                                 "type":"phrase",
                                 "operator":"and"
                              }
                           },
                           {
                              "multi_match":{
                                 "query":"data warehouse",
                                 "fields":[
                                    "title"
                                 ],
                                 "type":"phrase_prefix",
                                 "operator":"and"
                              }
                           }
                        ],
                        "minimum_should_match":"1"
                     }
                  }
               }
            }
         ]
      }
   },
   "highlight":{
      "pre_tags":[
         "<mark>"
      ],
      "post_tags":[
         "</mark>"
      ],
      "fields":{
         "title":{
            
         }
      },
      "require_field_match":false
   },
   "size":10,
   "_source":{
      "includes":[
         "*"
      ],
      "excludes":[
         
      ]
   }
}
headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("POST", url, headers=headers, data=data)

print(response.text.encode('utf8'))

Response

200 OK

{
  "took" : 1,
  "timed_out" : false,
  "_shards" : {
    "failed" : 0.0,
    "successful" : 2.0,
    "total" : 2.0,
    "skipped" : 0.0
  },
  "hits" : {
    "total" : {
      "relation" : "eq",
      "value" : 1
    },
    "hits" : [ {
      "_index" : "datasets",
      "_id" : "912828e6-8b5d-4945-a410-4bccea444747",
      "_score" : 47.769234,
      "_source" : {
        "id" : "912828e6-8b5d-4945-a410-4bccea444747",
        "tags" : [ "fantastic", "postgres" ],
        "title" : "What tables are in our #fantastic data warehouse?",
        "description" : "# Overview\nThis example is a standalone data set with no visualisation.\n\n## What tables are in my data warehouse\nOur query in this dataset selects all the tables in the same schema we have configured the workspace to use.\n```SHOW TABLES```\n\n## Notes\nThe query is database specific.  The #postgres query is\n\n```SELECT * FROM pg_tables where schemaname = 'lyfzgor'```",
        "workspaceId" : "8639773d-6b49-40e6-b7f0-4ee2857bfa6e",
        "workspaceOwnerProfile" : "auth0|5eb0327cbfd7490bff55feeb",
        "inChannelName" : "no-picture",
        "channelName" : "no-picture",
        "channelDescription" : "No picture",
        "channelPicture" : "https://s.gravatar.com/avatar/8f4ad8fa0793181b761d030196e62053?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fsu.png",
        "comments" : [ ],
        "alias" : "analytics-tables",
        "visualisation" : "{\"google-chart\": {\"chartType\": \"Table\", \"options\": {\"title\": \"Tables\"}}}",
        "metadata" : "  {    \"name\":\"table_model\",    \"label\":\"Analytics Tables\",    \"related_table\":{      \"columns\":[        {          \"name\":\"schemaname\",          \"label\":\"Schema Name\"        }      ]    }  }",
        "likedByProfiles" : [ ],
        "likeCount" : 0,
        "viewCount" : 0,
        "commentCount" : 0,
        "created" : "2024-12-16T09:58:32.678061Z",
        "lastModified" : "2024-12-16T09:58:32.678061Z",
        "lastModifiedMillisDay" : 35912678,
        "query" : "SELECT schemaname \"table_model.schemaname\",tablename \"table_model.tablename\",tableowner \"table_model.tableowner\"FROM pg_tables where schemaname = 'lyfzgor'",
        "lastCommentDate" : "2024-12-16T09:58:32.678061Z",
        "lastCommentMillisDay" : 35912678
      }
    } ],
    "max_score" : 47.769234
  }
}

204 No Content

No response body provided.