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

# Search Collection

> Search within a collection using knowledge search.

Supports different search types:
- fulltext: Traditional text-based search
- semantic: Vector similarity search
- hybrid: Combination of fulltext and semantic search



## OpenAPI

````yaml api-reference/openapi.json post /api/v1/collections/search
openapi: 3.1.0
info:
  title: FastAPI app
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/collections/search:
    post:
      tags:
        - Collections
      summary: Search Collection
      description: |-
        Search within a collection using knowledge search.

        Supports different search types:
        - fulltext: Traditional text-based search
        - semantic: Vector similarity search
        - hybrid: Combination of fulltext and semantic search
      operationId: search_collection_api_v1_collections_search_post
      parameters:
        - name: X-Workspace-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: The workspace ID
            title: X-Workspace-Id
          description: The workspace ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
        '404':
          description: Collection not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - DualAuthScheme: []
components:
  schemas:
    SearchRequest:
      properties:
        query:
          type: string
          title: Query
          description: Search query string
        search_type:
          $ref: '#/components/schemas/SearchType'
          description: Type of search to perform
          default: hybrid
        filters:
          additionalProperties: true
          type: object
          title: Filters
          description: Additional filters to apply
        collection_id:
          type: string
          title: Collection Id
          description: ID of the collection to search in
        max_results:
          type: integer
          maximum: 100
          minimum: 1
          title: Max Results
          description: Maximum number of results to return
          default: 10
      type: object
      required:
        - query
        - collection_id
      title: SearchRequest
      description: Request schema for knowledge search.
    SearchResponse:
      properties:
        results:
          items:
            $ref: '#/components/schemas/SearchResult'
          type: array
          title: Results
          description: List of search results
        total_results:
          type: integer
          title: Total Results
          description: Total number of results found
        query:
          type: string
          title: Query
          description: Original search query
        search_type:
          $ref: '#/components/schemas/SearchType'
          description: Type of search performed
        collection_id:
          type: string
          title: Collection Id
          description: Collection that was searched
        execution_time_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Execution Time Ms
          description: Search execution time in milliseconds
      type: object
      required:
        - results
        - total_results
        - query
        - search_type
        - collection_id
      title: SearchResponse
      description: Response schema for knowledge search.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SearchType:
      type: string
      enum:
        - vector
        - keyword
        - hybrid
      title: SearchType
    SearchResult:
      properties:
        content:
          type: string
          title: Content
          description: The content text
        score:
          type: number
          title: Score
          description: Relevance score
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
          description: Additional metadata
        content_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Id
          description: ID of the content
        source:
          anyOf:
            - type: string
            - type: 'null'
          title: Source
          description: Source of the content
      type: object
      required:
        - content
        - score
      title: SearchResult
      description: Individual search result.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    DualAuthScheme:
      type: http
      scheme: bearer

````