Skip to main content
POST
/
partitions
/
{partitionKey}
/
v1
/
objects
/
{collectionKey}
/
query
Search objects of a specific type in the data partition
curl --request POST \
  --url https://{workspaceId}.clinia.cloud/partitions/{partitionKey}/v1/objects/{collectionKey}/query \
  --header 'Content-Type: application/json' \
  --header 'X-Clinia-API-Key: <api-key>' \
  --data '{
  "semanticQuery": {
    "value": "<string>",
    "paths": {
      "include": [
        "<string>"
      ],
      "exclude": [
        "<string>"
      ]
    }
  },
  "query": {
    "id": "<string>",
    "and": [
      "<any>"
    ]
  },
  "filter": {
    "id": "<string>",
    "and": [
      "<any>"
    ]
  },
  "properties": {
    "include": [
      "<string>"
    ],
    "exclude": [
      "<string>"
    ]
  },
  "highlighting": [
    "<string>"
  ],
  "page": 123,
  "perPage": 20,
  "sort": {
    "direction": "DESC",
    "path": "<string>"
  },
  "ranking": {
    "type": "DEFAULT"
  },
  "aggregations": [
    {
      "type": "LEXICAL",
      "path": "<string>",
      "prefix": "<string>",
      "size": 20
    }
  ],
  "traversedProperties": [
    "<string>"
  ]
}'
{
  "semanticQueryInfo": {
    "reasoning": "<string>",
    "originalQuery": "<string>",
    "query": {
      "id": "<string>",
      "and": [
        "<any>"
      ]
    },
    "filter": {
      "id": "<string>",
      "and": [
        "<any>"
      ]
    }
  },
  "hits": [
    {
      "hitType": "RESOURCE",
      "score": 123,
      "resource": {},
      "traversedProperties": {},
      "highlighting": {}
    }
  ],
  "meta": {
    "numPages": 123,
    "page": 123,
    "perPage": 123,
    "total": 123,
    "filter": {
      "id": "<string>",
      "and": [
        "<any>"
      ]
    }
  },
  "aggregates": [
    {
      "type": "LEXICAL",
      "path": "<string>",
      "aggregate": [
        {
          "value": "<string>",
          "count": 123
        }
      ]
    }
  ]
}

Authorizations

X-Clinia-API-Key
string
header
required

Path Parameters

partitionKey
string
required

The partition from which to execute the query.

collectionKey
string
required

The key of the object collection.

Body

application/json

Use dot-notation paths (e.g., name, meta.updatedAt, address.city). To include properties from relationships or adjacent records, request them via traversedProperties and reference with @ (e.g., @worksAt.*, @worksAt.@clinic.name). Some endpoints require federated paths such as resources.<collectionKey>.<propertyKey> or relationships.<collectionKey>.<propertyKey>.

semanticQuery
object

A semantic query is a high-level representation of the user's intent. When specified, it will trigger our query understanding capabilities and generate a query and filter operator that will be applied to the search parameters.

query
object

An operator that will be used to search the targeted collections. The matching operator will count as part of the ranking.

  • Option 1
  • Option 2
  • Option 3
  • Option 4
  • Option 5
  • Option 6
  • Option 7
  • Option 8
  • Option 9
  • Option 10
  • Option 11
  • Option 12
filter
object

An operator that will be used to filter the targeted collections. The filtering operator excludes results that do not match the specified criteria.

  • Option 1
  • Option 2
  • Option 3
  • Option 4
  • Option 5
  • Option 6
  • Option 7
  • Option 8
  • Option 9
  • Option 10
  • Option 11
  • Option 12
properties
object

Properties selector allows to specify which properties should be included or excluded in the search response. System properties are always included and cannot be excluded. Exclude properties has precedence over include properties.

highlighting
string[]
page
integer
perPage
integer
default:20
sort
object
ranking
object
  • Option 1
  • Option 2
aggregations
object[]
traversedProperties
string[]

The properties from the relationships or adjacent records that will be returned in the search response. The wildcard '*' can be used in itself or in combination with a prefix

  • * will return all traversed properties.
  • @worksAt.* will return all traversed properties from the relationship 'worksAt'.
  • @worksAt.@clinic.* will return all traversed properties from an adjacent 'clinic' connected with a 'worksAt' relationship.

Response

A successful response.

hits
object[]
required
meta
object
required
aggregates
object[]
required
semanticQueryInfo
object
I