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

# Search document summaries

> Perform a search query on the automatically generated document summaries in the system.

This endpoint allows for complex filtering of search results using PostgreSQL-based queries. Filters can be applied to various fields such as document\_id, and internal metadata values.

Allowed operators include `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `like`, `ilike`, `in`, and `nin`.


## OpenAPI

````yaml /openapi/rag-documents/search-documents.json POST /api/r2r/v3/documents/search
openapi: 3.1.0
info:
  title: IO Intelligence
  version: '1.0'
servers:
  - url: https://api.intelligence.io.solutions
security:
  - sec0: []
paths:
  /api/r2r/v3/documents/search:
    post:
      summary: Search document summaries
      description: >-
        Perform a search query on the automatically generated document summaries
        in the system.
      operationId: search-documents
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - query
              properties:
                query:
                  type: string
                  description: The search query to perform.
                search_mode:
                  type: string
                  description: >-
                    Default value of custom allows full control over search
                    settings.  Pre-configured search modes: basic: A simple
                    semantic-based search. advanced: A more powerful hybrid
                    search combining semantic and full-text. custom: Full
                    control via search_settings.  If filters or limit are
                    provided alongside basic or advanced, they will override the
                    default settings for that mode.
                  enum:
                    - basic
                    - advanced
                    - custom
                search_settings:
                  type: object
                  description: Settings for document search
                  properties:
                    use_hybrid_search:
                      type: boolean
                      description: >-
                        Whether to perform a hybrid search. This is equivalent
                        to setting use_semantic_search=True and
                        use_fulltext_search=True, e.g. combining vector and
                        keyword search.
                      default: false
                    use_semantic_search:
                      type: boolean
                      description: Whether to use semantic search
                      default: true
                    use_fulltext_search:
                      type: boolean
                      description: Whether to use full-text search
                      default: false
                    filters:
                      type: string
                      description: >-
                        Filters to apply to the search. Allowed operators
                        include eq, neq, gt, gte, lt, lte, like, ilike, in, and
                        nin.  Commonly seen filters include operations include
                        the following:  {"document_id": {"$eq":
                        "9fbe403b-..."}}  {"document_id": {"$in":
                        ["9fbe403b-...", "3e157b3a-..."]}}  {"collection_ids":
                        {"$overlap": ["122fdf6a-...", "..."]}}  {"$and":
                        {"$document_id": ..., "collection_ids": ...}}
                    limit:
                      type: integer
                      description: Maximum number of results to return. >=1 <=1000
                      default: 10
                      format: int32
                    offset:
                      type: string
                      description: Offset to paginate search results
                      default: '0'
                    include_metadatas:
                      type: boolean
                      description: >-
                        Whether to include element metadata in the search
                        results
                      default: true
                    include_scores:
                      type: boolean
                      description: >-
                        Whether to include search score values in the search
                        results
                      default: true
                    search_strategy:
                      type: string
                      description: >-
                        Search strategy to use (e.g., ‘vanilla’, ‘query_fusion’,
                        ‘hyde’)
                      default: vanilla
                    hybrid_settings:
                      type: object
                      description: >-
                        Settings for hybrid search (only used if
                        use_semantic_search and use_fulltext_search are both
                        true)
                      properties:
                        full_text_weight:
                          type: number
                          description: Weight to apply to full text search
                          default: 1
                          format: double
                        semantic_weight:
                          type: number
                          description: Weight to apply to semantic search
                          default: 5
                          format: double
                        full_text_limit:
                          type: integer
                          description: >-
                            Maximum number of results to return from full text
                            search
                          default: 200
                          format: int32
                        rrf_k:
                          type: integer
                          description: K-value for RRF (Rank Reciprocal Fusion)
                          default: 50
                          format: int32
                    chunk_settings:
                      type: object
                      description: Settings specific to chunk/vector search
                      properties:
                        index_measure:
                          type: string
                          description: The distance measure to use for indexing
                          enum:
                            - l2_distance
                            - max_inner_product
                            - cosine_distance
                            - l1_distance
                            - hamming_distance
                            - jaccard_distance
                        probes:
                          type: integer
                          description: >-
                            Number of ivfflat index lists to query. Higher
                            increases accuracy but decreases speed.
                          default: 10
                          format: int32
                        ef_search:
                          type: integer
                          description: >-
                            Size of the dynamic candidate list for HNSW index
                            search. Higher increases accuracy but decreases
                            speed.
                          default: 40
                          format: int32
                        enabled:
                          type: boolean
                          description: Whether to enable chunk search
                          default: true
                    graph_settings:
                      type: object
                      description: Settings specific to knowledge graph search
                      properties:
                        limits:
                          type: array
                        enabled:
                          type: boolean
                          description: Whether to enable graph search
                          default: true
                    num_sub_queries:
                      type: integer
                      description: >-
                        Number of sub-queries/hypothetical docs to generate when
                        using hyde or rag_fusion search strategies.
                      default: 5
                      format: int32
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    results:
                      - id: 123e4567-e89b-12d3-a456-426614174000
                        collection_ids:
                          - 123e4567-e89b-12d3-a456-426614174000
                        owner_id: 123e4567-e89b-12d3-a456-426614174000
                        document_type: pdf
                        metadata:
                          title: Sample Document
                        version: '1.0'
                        title: Sample Document
                        size_in_bytes: 123456
                        ingestion_status: pending
                        extraction_status: pending
                        created_at: '2021-01-01T00:00:00Z'
                        updated_at: '2021-01-01T00:00:00Z'
                        ingestion_attempt_number: 0
                        summary: A summary of the document
                        summary_embedding:
                          - 0.1
                          - 0.2
                          - 0.3
                        total_tokens: 1000
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: 123e4567-e89b-12d3-a456-426614174000
                        collection_ids:
                          type: array
                          items:
                            type: string
                            example: 123e4567-e89b-12d3-a456-426614174000
                        owner_id:
                          type: string
                          example: 123e4567-e89b-12d3-a456-426614174000
                        document_type:
                          type: string
                          example: pdf
                        metadata:
                          type: object
                          properties:
                            title:
                              type: string
                              example: Sample Document
                        version:
                          type: string
                          example: '1.0'
                        title:
                          type: string
                          example: Sample Document
                        size_in_bytes:
                          type: integer
                          example: 123456
                          default: 0
                        ingestion_status:
                          type: string
                          example: pending
                        extraction_status:
                          type: string
                          example: pending
                        created_at:
                          type: string
                          example: '2021-01-01T00:00:00Z'
                        updated_at:
                          type: string
                          example: '2021-01-01T00:00:00Z'
                        ingestion_attempt_number:
                          type: integer
                          example: 0
                          default: 0
                        summary:
                          type: string
                          example: A summary of the document
                        summary_embedding:
                          type: array
                          items:
                            type: number
                            example: 0.1
                            default: 0
                        total_tokens:
                          type: integer
                          example: 1000
                          default: 0
        '404':
          description: '404'
          content:
            application/json:
              examples:
                Result:
                  value: {}
              schema:
                type: object
                properties: {}
        '422':
          description: '422'
          content:
            text/plain:
              examples:
                Result:
                  value: ''
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: oauth2
      flows: {}

````