---
title: "Search accross resource or relationship collections in the data partition"
method: POST
path: "/partitions/{partitionKey}/v1/federated/{collectionKeys}/query"
tags: ["Search"]
---

# Search accross resource or relationship collections in the data partition

`POST /partitions/{partitionKey}/v1/federated/{collectionKeys}/query`

## Request

- Base URL: `https://.clinia.cloud`
- URL: `https://.clinia.cloud/partitions/{partitionKey}/v1/federated/{collectionKeys}/query`
- Auth: API key in header `X-Clinia-API-Key`

Search across resource or relationship collections in the data partition.
This endpoint only accept federated search paths, which means that one using an operator it expects the collection type and collection key to be specified in the path.
For example, `resources.<collectionKey>.<propertyKey>`.

## Path parameters

- `partitionKey` string, required
- `collectionKeys` string, required

## Request body

- V1SearchParameters
  - `semanticQuery` V1SemanticQuery: 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.
    - `value` string, required: The text value of the semantic query.
  - `query` union
    - object
      - `id` string
      - `and` V1Operator[], required
    - object
      - `id` string
      - `or` V1Operator[], required
    - object
      - `id` string
      - `all` object, required
    - object
      - `id` string
      - `any` object, required
    - object
      - `id` string
      - `composite` object, required
    - object
      - `id` string
      - `eq` object, required
    - object
      - `id` string
      - `knn` object, required
    - object
      - `id` string
      - `geoDistance` object, required
    - object
      - `id` string
      - `gt` object, required
    - object
      - `id` string
      - `lt` object, required
    - object
      - `id` string
      - `match` object, required
    - object
      - `id` string
      - `not` V1Operator, required (recursive)
  - `filter` union
    - object
      - `id` string
      - `and` V1Operator[], required
    - object
      - `id` string
      - `or` V1Operator[], required
    - object
      - `id` string
      - `all` object, required
    - object
      - `id` string
      - `any` object, required
    - object
      - `id` string
      - `composite` object, required
    - object
      - `id` string
      - `eq` object, required
    - object
      - `id` string
      - `knn` object, required
    - object
      - `id` string
      - `geoDistance` object, required
    - object
      - `id` string
      - `gt` object, required
    - object
      - `id` string
      - `lt` object, required
    - object
      - `id` string
      - `match` object, required
    - object
      - `id` string
      - `not` V1Operator, required (recursive)
  - `highlighting` string[]
  - `page` integer
  - `perPage` integer
  - `sort` V1Sort
    - `direction` 'DESC' | 'ASC'
    - `path` string, required
  - `ranking` union
    - object
      - `type` 'DEFAULT' | 'SEMANTIC', required
    - object
      - `type` 'DEFAULT' | 'SEMANTIC', required
      - `query` string, required
      - `path` string, required
      - `modelId` string, required
  - `aggregations` V1Aggregation[]
    - `type` 'LEXICAL', required
    - `path` string, required: The path of the property to aggregate.
    - `prefix` string: The prefix is an optional query to filter the values to aggregate (e.g. 'mont' would match 'montreal', 'Montecarlo', etc.).
    - `size` integer: The maximum number of unique values to return in the aggregation.
  - `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 `200`

A successful response.

- V1QueryResponse
  - `semanticQueryInfo` V1SemanticQueryInfo
    - `reasoning` string, required: The reasoning behind the semantic query.
    - `originalQuery` string, required: The original query text provided by the user.
    - `query` union
      - object
        - `id` string
        - `and` V1Operator[], required
      - object
        - `id` string
        - `or` V1Operator[], required
      - object
        - `id` string
        - `all` object, required
      - object
        - `id` string
        - `any` object, required
      - object
        - `id` string
        - `composite` object, required
      - object
        - `id` string
        - `eq` object, required
      - object
        - `id` string
        - `knn` object, required
      - object
        - `id` string
        - `geoDistance` object, required
      - object
        - `id` string
        - `gt` object, required
      - object
        - `id` string
        - `lt` object, required
      - object
        - `id` string
        - `match` object, required
      - object
        - `id` string
        - `not` V1Operator, required (recursive)
    - `filter` union
      - object
        - `id` string
        - `and` V1Operator[], required
      - object
        - `id` string
        - `or` V1Operator[], required
      - object
        - `id` string
        - `all` object, required
      - object
        - `id` string
        - `any` object, required
      - object
        - `id` string
        - `composite` object, required
      - object
        - `id` string
        - `eq` object, required
      - object
        - `id` string
        - `knn` object, required
      - object
        - `id` string
        - `geoDistance` object, required
      - object
        - `id` string
        - `gt` object, required
      - object
        - `id` string
        - `lt` object, required
      - object
        - `id` string
        - `match` object, required
      - object
        - `id` string
        - `not` V1Operator, required (recursive)
  - `hits` V1Hit[], required
    - `hitType` 'RESOURCE' | 'RELATIONSHIP' | 'OBJECT' | 'CONCEPT' | 'PIPELINE_EXECUTION' | 'RESOLUTION_QUEUED_ITEM', required
    - `score` number, double, required: The score of the hit in the search results, indicating its relevance.
    - `resource` object, required
    - `traversedProperties` unknown
    - `highlighting` unknown
  - `meta` V1QueryResponseMeta, required
    - `numPages` integer, required
    - `page` integer, required
    - `perPage` integer, required
    - `total` integer, required
    - `filter` union
      - object
        - `id` string
        - `and` V1Operator[], required
      - object
        - `id` string
        - `or` V1Operator[], required
      - object
        - `id` string
        - `all` object, required
      - object
        - `id` string
        - `any` object, required
      - object
        - `id` string
        - `composite` object, required
      - object
        - `id` string
        - `eq` object, required
      - object
        - `id` string
        - `knn` object, required
      - object
        - `id` string
        - `geoDistance` object, required
      - object
        - `id` string
        - `gt` object, required
      - object
        - `id` string
        - `lt` object, required
      - object
        - `id` string
        - `match` object, required
      - object
        - `id` string
        - `not` V1Operator, required (recursive)
  - `aggregates` V1Aggregate[], required
    - `type` 'LEXICAL', required
    - `path` string, required: The path of the property to aggregate.
    - `aggregate` V1LexicalAggregateItem[], required
      - `value` string, required
      - `count` integer, required

## Other responses

- `400`: Returned when the request is malformed or invalid.
- `404`: Returned when the resource type does not exist.
- `413`: Returned when the payload exceeds the max content size (100kB).

---

[API](https://skmtc.dev/clinia/apis/data-partition-api.md) - [All operations](https://skmtc.dev/clinia/apis/data-partition-api/llms.txt) - [OpenAPI document](https://skmtc.dev/clinia/apis/data-partition-api/revisions/d95b0e95e86c?raw)
