---
title: "Run multiple queries"
method: POST
path: "/partitions/{partitionKey}/v1/queries"
tags: ["Search"]
---

# Run multiple queries

`POST /partitions/{partitionKey}/v1/queries`

## Request

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

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.

## Path parameters

- `partitionKey` string, required

## Request body

- V1MultiQueryRequest
  - `requests` V1MultiQueryRequestItem[], required: The list of queries to execute.
    - `collectionKeys` string[], required: The collection keys to which the query applies. If the total of the collection keys is greater than 1, it is going to be executed as a federated query, meaning that you will need to provide the full path `<collectionType>.<collectionKey>.<propertyKey>` vs <propertyKey>.
    - `params` V1SearchParameters, required
      - `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.

- V1MultiQueryResponse
  - `responses` V1MultiQueryResponseItem[], required: The responses for each corresponding requests.
    - `collectionKeys` string[]: The collection keys to which the query applies.
    - `response` V1QueryResponse, required
      - `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)
