Run multiple queries
curl --request POST \
--url https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/queries \
--header 'Content-Type: application/json' \
--header 'X-Clinia-API-Key: <api-key>' \
--data '
{
"requests": [
{
"collectionKeys": [
"<string>"
],
"params": {
"query": {
"and": "<array>",
"id": "<string>"
},
"filter": {
"and": "<array>",
"id": "<string>"
},
"properties": {
"include": [
"<string>"
],
"exclude": [
"<string>"
]
},
"highlighting": [
"<string>"
],
"page": 123,
"perPage": 20,
"aggregations": [
{
"type": "LEXICAL",
"path": "<string>",
"prefix": "<string>",
"size": 20
}
],
"traversedProperties": [
"<string>"
]
}
}
]
}
'import requests
url = "https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/queries"
payload = { "requests": [
{
"collectionKeys": ["<string>"],
"params": {
"query": {
"and": "<array>",
"id": "<string>"
},
"filter": {
"and": "<array>",
"id": "<string>"
},
"properties": {
"include": ["<string>"],
"exclude": ["<string>"]
},
"highlighting": ["<string>"],
"page": 123,
"perPage": 20,
"aggregations": [
{
"type": "LEXICAL",
"path": "<string>",
"prefix": "<string>",
"size": 20
}
],
"traversedProperties": ["<string>"]
}
}
] }
headers = {
"X-Clinia-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Clinia-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requests: [
{
collectionKeys: ['<string>'],
params: {
query: {and: '<array>', id: '<string>'},
filter: {and: '<array>', id: '<string>'},
properties: {include: ['<string>'], exclude: ['<string>']},
highlighting: ['<string>'],
page: 123,
perPage: 20,
aggregations: [{type: 'LEXICAL', path: '<string>', prefix: '<string>', size: 20}],
traversedProperties: ['<string>']
}
}
]
})
};
fetch('https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/queries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/queries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'requests' => [
[
'collectionKeys' => [
'<string>'
],
'params' => [
'query' => [
'and' => '<array>',
'id' => '<string>'
],
'filter' => [
'and' => '<array>',
'id' => '<string>'
],
'properties' => [
'include' => [
'<string>'
],
'exclude' => [
'<string>'
]
],
'highlighting' => [
'<string>'
],
'page' => 123,
'perPage' => 20,
'aggregations' => [
[
'type' => 'LEXICAL',
'path' => '<string>',
'prefix' => '<string>',
'size' => 20
]
],
'traversedProperties' => [
'<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Clinia-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/queries"
payload := strings.NewReader("{\n \"requests\": [\n {\n \"collectionKeys\": [\n \"<string>\"\n ],\n \"params\": {\n \"query\": {\n \"and\": \"<array>\",\n \"id\": \"<string>\"\n },\n \"filter\": {\n \"and\": \"<array>\",\n \"id\": \"<string>\"\n },\n \"properties\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"highlighting\": [\n \"<string>\"\n ],\n \"page\": 123,\n \"perPage\": 20,\n \"aggregations\": [\n {\n \"type\": \"LEXICAL\",\n \"path\": \"<string>\",\n \"prefix\": \"<string>\",\n \"size\": 20\n }\n ],\n \"traversedProperties\": [\n \"<string>\"\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Clinia-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/queries")
.header("X-Clinia-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"requests\": [\n {\n \"collectionKeys\": [\n \"<string>\"\n ],\n \"params\": {\n \"query\": {\n \"and\": \"<array>\",\n \"id\": \"<string>\"\n },\n \"filter\": {\n \"and\": \"<array>\",\n \"id\": \"<string>\"\n },\n \"properties\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"highlighting\": [\n \"<string>\"\n ],\n \"page\": 123,\n \"perPage\": 20,\n \"aggregations\": [\n {\n \"type\": \"LEXICAL\",\n \"path\": \"<string>\",\n \"prefix\": \"<string>\",\n \"size\": 20\n }\n ],\n \"traversedProperties\": [\n \"<string>\"\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/queries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Clinia-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"requests\": [\n {\n \"collectionKeys\": [\n \"<string>\"\n ],\n \"params\": {\n \"query\": {\n \"and\": \"<array>\",\n \"id\": \"<string>\"\n },\n \"filter\": {\n \"and\": \"<array>\",\n \"id\": \"<string>\"\n },\n \"properties\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"highlighting\": [\n \"<string>\"\n ],\n \"page\": 123,\n \"perPage\": 20,\n \"aggregations\": [\n {\n \"type\": \"LEXICAL\",\n \"path\": \"<string>\",\n \"prefix\": \"<string>\",\n \"size\": 20\n }\n ],\n \"traversedProperties\": [\n \"<string>\"\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"responses": [
{
"collectionKeys": [
"<string>"
],
"response": {
"hits": [
{
"score": 123,
"resource": {},
"traversedProperties": {},
"highlighting": {}
}
],
"meta": {
"numPages": 123,
"page": 123,
"perPage": 123,
"total": 123,
"filter": {
"and": "<array>",
"id": "<string>"
}
},
"aggregates": [
{
"type": "LEXICAL",
"path": "<string>",
"aggregate": [
{
"value": "<string>",
"count": 123
}
]
}
],
"semanticQueryInfo": {
"originalQuery": "<string>",
"reasoning": "<string>",
"query": {
"and": "<array>",
"id": "<string>"
},
"filter": {
"and": "<array>",
"id": "<string>"
}
}
}
}
]
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}Search
Run multiple queries
Execute several queries within a single request. It is possible to send multiple query items, where each of the item can be either a regular query or a federated query. To trigger a federated query, one must specify more then one collection key in the item.
POST
/
sources
/
{sourceKey}
/
v1
/
queries
Run multiple queries
curl --request POST \
--url https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/queries \
--header 'Content-Type: application/json' \
--header 'X-Clinia-API-Key: <api-key>' \
--data '
{
"requests": [
{
"collectionKeys": [
"<string>"
],
"params": {
"query": {
"and": "<array>",
"id": "<string>"
},
"filter": {
"and": "<array>",
"id": "<string>"
},
"properties": {
"include": [
"<string>"
],
"exclude": [
"<string>"
]
},
"highlighting": [
"<string>"
],
"page": 123,
"perPage": 20,
"aggregations": [
{
"type": "LEXICAL",
"path": "<string>",
"prefix": "<string>",
"size": 20
}
],
"traversedProperties": [
"<string>"
]
}
}
]
}
'import requests
url = "https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/queries"
payload = { "requests": [
{
"collectionKeys": ["<string>"],
"params": {
"query": {
"and": "<array>",
"id": "<string>"
},
"filter": {
"and": "<array>",
"id": "<string>"
},
"properties": {
"include": ["<string>"],
"exclude": ["<string>"]
},
"highlighting": ["<string>"],
"page": 123,
"perPage": 20,
"aggregations": [
{
"type": "LEXICAL",
"path": "<string>",
"prefix": "<string>",
"size": 20
}
],
"traversedProperties": ["<string>"]
}
}
] }
headers = {
"X-Clinia-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Clinia-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requests: [
{
collectionKeys: ['<string>'],
params: {
query: {and: '<array>', id: '<string>'},
filter: {and: '<array>', id: '<string>'},
properties: {include: ['<string>'], exclude: ['<string>']},
highlighting: ['<string>'],
page: 123,
perPage: 20,
aggregations: [{type: 'LEXICAL', path: '<string>', prefix: '<string>', size: 20}],
traversedProperties: ['<string>']
}
}
]
})
};
fetch('https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/queries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/queries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'requests' => [
[
'collectionKeys' => [
'<string>'
],
'params' => [
'query' => [
'and' => '<array>',
'id' => '<string>'
],
'filter' => [
'and' => '<array>',
'id' => '<string>'
],
'properties' => [
'include' => [
'<string>'
],
'exclude' => [
'<string>'
]
],
'highlighting' => [
'<string>'
],
'page' => 123,
'perPage' => 20,
'aggregations' => [
[
'type' => 'LEXICAL',
'path' => '<string>',
'prefix' => '<string>',
'size' => 20
]
],
'traversedProperties' => [
'<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Clinia-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/queries"
payload := strings.NewReader("{\n \"requests\": [\n {\n \"collectionKeys\": [\n \"<string>\"\n ],\n \"params\": {\n \"query\": {\n \"and\": \"<array>\",\n \"id\": \"<string>\"\n },\n \"filter\": {\n \"and\": \"<array>\",\n \"id\": \"<string>\"\n },\n \"properties\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"highlighting\": [\n \"<string>\"\n ],\n \"page\": 123,\n \"perPage\": 20,\n \"aggregations\": [\n {\n \"type\": \"LEXICAL\",\n \"path\": \"<string>\",\n \"prefix\": \"<string>\",\n \"size\": 20\n }\n ],\n \"traversedProperties\": [\n \"<string>\"\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Clinia-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/queries")
.header("X-Clinia-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"requests\": [\n {\n \"collectionKeys\": [\n \"<string>\"\n ],\n \"params\": {\n \"query\": {\n \"and\": \"<array>\",\n \"id\": \"<string>\"\n },\n \"filter\": {\n \"and\": \"<array>\",\n \"id\": \"<string>\"\n },\n \"properties\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"highlighting\": [\n \"<string>\"\n ],\n \"page\": 123,\n \"perPage\": 20,\n \"aggregations\": [\n {\n \"type\": \"LEXICAL\",\n \"path\": \"<string>\",\n \"prefix\": \"<string>\",\n \"size\": 20\n }\n ],\n \"traversedProperties\": [\n \"<string>\"\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/queries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Clinia-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"requests\": [\n {\n \"collectionKeys\": [\n \"<string>\"\n ],\n \"params\": {\n \"query\": {\n \"and\": \"<array>\",\n \"id\": \"<string>\"\n },\n \"filter\": {\n \"and\": \"<array>\",\n \"id\": \"<string>\"\n },\n \"properties\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"highlighting\": [\n \"<string>\"\n ],\n \"page\": 123,\n \"perPage\": 20,\n \"aggregations\": [\n {\n \"type\": \"LEXICAL\",\n \"path\": \"<string>\",\n \"prefix\": \"<string>\",\n \"size\": 20\n }\n ],\n \"traversedProperties\": [\n \"<string>\"\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"responses": [
{
"collectionKeys": [
"<string>"
],
"response": {
"hits": [
{
"score": 123,
"resource": {},
"traversedProperties": {},
"highlighting": {}
}
],
"meta": {
"numPages": 123,
"page": 123,
"perPage": 123,
"total": 123,
"filter": {
"and": "<array>",
"id": "<string>"
}
},
"aggregates": [
{
"type": "LEXICAL",
"path": "<string>",
"aggregate": [
{
"value": "<string>",
"count": 123
}
]
}
],
"semanticQueryInfo": {
"originalQuery": "<string>",
"reasoning": "<string>",
"query": {
"and": "<array>",
"id": "<string>"
},
"filter": {
"and": "<array>",
"id": "<string>"
}
}
}
}
]
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}Authorizations
apiKeybasicHttpAuthbearerHttpAuth
Path Parameters
The source from which to execute the query.
Body
application/json
The list of queries to execute. It is possible to send multiple query items, where each of the item can be either a regular query or a federated query.
The list of queries to execute.
Show child attributes
Show child attributes
Response
A successful response.
The list of responses for the multi query. The responses are returned in the same order as the requests.
The responses for each corresponding requests.
Show child attributes
Show child attributes
Was this page helpful?
Search accross resource or relationship collections in the data partitionBrowse accross resource or relationship collections in the data partition
⌘I