> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vectoraidb.actian.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch search

> Execute multiple search queries in a single request. This is more efficient than sending individual search requests when you have several queries to run.



## OpenAPI

````yaml post /collections/{collection_name}/points/search/batch
openapi: 3.0.3
info:
  title: Actian VectorAI DB - Search API
  description: Vector similarity search operations for Actian VectorAI DB.
  version: 1.0.0
  contact:
    name: Actian Corporation
    url: https://www.actian.com
servers:
  - url: http://localhost:6573
    description: Local development server (REST API)
  - url: https://api.vectorai.actian.com
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Search
    description: Vector similarity search operations
  - name: Scroll
    description: Pagination and iteration
  - name: Count
    description: Counting operations
paths:
  /collections/{collection_name}/points/search/batch:
    post:
      tags:
        - Search
      summary: Batch search
      description: >-
        Execute multiple search queries in a single request. This is more
        efficient than sending individual search requests when you have several
        queries to run.
      operationId: search_batch
      parameters:
        - name: collection_name
          in: path
          required: true
          schema:
            type: string
          description: The name of the collection to search.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - searches
              properties:
                searches:
                  type: array
                  description: Array of search request objects to execute.
                  items:
                    type: object
                    required:
                      - vector
                    properties:
                      vector:
                        type: array
                        items:
                          type: number
                        example:
                          - 0.1
                          - 0.2
                          - 0.3
                          - 0.4
                        description: The query vector for this search.
                      limit:
                        type: integer
                        example: 3
                        description: Maximum number of results for this search.
                      offset:
                        type: integer
                        example: 0
                        description: Number of results to skip for pagination.
                      score_threshold:
                        type: number
                        example: 0.7
                        description: Minimum similarity score for results.
                      filter:
                        type: object
                        description: Optional filter conditions for this search.
                      with_payload:
                        type: boolean
                        example: true
                        description: Whether to include payload metadata in the response.
                      with_vector:
                        type: boolean
                        example: false
                        description: Whether to include vector data in the response.
            examples:
              batch_search:
                summary: Multiple queries
                value:
                  searches:
                    - vector:
                        - 0.1
                        - 0.2
                        - 0.3
                        - 0.4
                      limit: 3
                      with_payload: true
                      with_vector: false
                    - vector:
                        - 0.5
                        - 0.6
                        - 0.7
                        - 0.8
                      limit: 3
                      with_payload: true
                      with_vector: false
                    - vector:
                        - 0.9
                        - 0.8
                        - 0.7
                        - 0.6
                      limit: 3
                      with_payload: true
                      with_vector: false
      responses:
        '200':
          description: Batch search results
          content:
            application/json:
              schema:
                type: object
                properties:
                  usage:
                    type: object
                    properties:
                      hardware:
                        type: object
                        nullable: true
                        description: >-
                          Hardware resource counters for the operation,
                          including CPU, payload I/O, payload index I/O, and
                          vector I/O metrics.
                  time:
                    type: number
                    format: double
                    example: 0.0000706
                    description: Time spent to process this request, in seconds.
                  status:
                    type: string
                    example: ok
                    description: Operation status.
                  result:
                    type: array
                    description: Array of result arrays, one per search query.
                    items:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            oneOf:
                              - type: integer
                              - type: string
                            example: 1
                            description: The point's unique identifier.
                          version:
                            type: integer
                            example: 0
                            description: The point's version number.
                          score:
                            type: number
                            example: 0.9843740463256836
                            description: >-
                              Similarity score between the query vector and this
                              point.
                          payload:
                            type: object
                            nullable: true
                            example: null
                            description: >-
                              Payload metadata, or null if `with_payload` is
                              false.
                          vector:
                            type: array
                            nullable: true
                            items:
                              type: number
                            example: null
                            description: Vector data, or null if `with_vector` is false.
              example:
                usage:
                  hardware: null
                time: 0.0000706
                status: ok
                result:
                  - - id: 1
                      version: 0
                      score: 1
                      payload: null
                      vector: null
                    - id: 3
                      version: 0
                      score: 0.9843740463256836
                      payload: null
                      vector: null
                    - id: 2
                      version: 0
                      score: 0.9688639640808105
                      payload: null
                      vector: null
                  - - id: 2
                      version: 0
                      score: 1
                      payload: null
                      vector: null
                    - id: 3
                      version: 0
                      score: 0.9973233938217163
                      payload: null
                      vector: null
        4XX:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: Python
          label: Batch search
          source: |
            from actian_vectorai_client import VectorAIClient
            import random

            with VectorAIClient("localhost:6574") as client:
                # Execute multiple searches at once
                queries = [
                    {"vector": [random.gauss(0, 1) for _ in range(64)], "limit": 3}
                    for _ in range(3)
                ]
                batch_results = client.points.search_batch("my_collection", queries)
                
                for i, results in enumerate(batch_results):
                    ids = [r.id for r in results]
                    print(f"Query {i + 1}: top IDs = {ids}")
        - lang: JavaScript
          label: Batch search
          source: >
            import { VectorAIClient } from '@actian/vectorai-client';


            const client = new VectorAIClient('localhost:6574');


            const batchResults = await
            client.points.searchBatch('my_collection', [
                { vector: [0.1, 0.2, 0.3, 0.4], limit: 3 },
                { vector: [0.5, 0.6, 0.7, 0.8], limit: 3 },
            ]);

            console.log(`Batch search: ${batchResults.length} result sets`);

            for (let i = 0; i < batchResults.length; i++) {
                console.log(`  Query ${i}: ${batchResults[i].length} results`);
            }


            client.close();
        - lang: cURL
          label: Batch search
          source: >
            curl -X POST
            "http://localhost:6573/collections/my_collection/points/search/batch"
            \
              -H "Content-Type: application/json" \
              -H 'Authorization: Bearer <admin-jwt-or-access-token>' \
              -d '{
                "searches": [
                  {"vector": [0.1, 0.2, 0.3, 0.4], "limit": 3},
                  {"vector": [0.5, 0.6, 0.7, 0.8], "limit": 3}
                ]
              }'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        status:
          type: object
          properties:
            error:
              type: string
        time:
          type: number
          format: double
          description: Time spent to process this request, in seconds.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Admin JWT or access token for authenticating requests to VectorAI DB.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.