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

# Search

> Run a search query.



## OpenAPI

````yaml api-reference/endpoint/platform/openapi.json post /v1/query/search/{docset_id}
openapi: 3.1.0
info:
  title: Aryn Platform API
  version: 0.1.0
servers:
  - url: https://api.aryn.cloud
    description: US Region
  - url: https://api.aryn.ai
    description: US Region
  - url: https://api.us.aryn.cloud
    description: US Region
  - url: https://api.us.aryn.ai
    description: US Region
security: []
paths:
  /v1/query/search/{docset_id}:
    post:
      tags:
        - Query
      summary: Search
      description: Run a search query.
      operationId: query_v1_query_search__docset_id__post
      parameters:
        - name: docset_id
          in: path
          required: true
          schema:
            type: string
            description: The ID of the docset to query.
            title: Docset Id
          description: The ID of the docset to query.
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            description: The number of results to return per page.
            default: 100
            title: Page Size
          description: The number of results to return per page.
        - name: page_token
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Reserved for future use. A pagination token to retrieve the next
              page of results.
            title: Page Token
          description: >-
            Reserved for future use. A pagination token to retrieve the next
            page of results.
      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: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    SearchRequest:
      properties:
        query:
          anyOf:
            - type: string
            - type: 'null'
          title: Query
          description: The query to search for
        query_type:
          type: string
          enum:
            - keyword
            - lexical
            - vector
            - hybrid
          title: Query Type
          description: The type of query to perform.
          default: lexical
        properties_filter:
          anyOf:
            - type: string
            - type: 'null'
          title: Properties Filter
          description: A filter to apply to the properties of the documents.
        return_type:
          type: string
          enum:
            - doc
            - element
          title: Return Type
          description: The type of result to return.
          default: doc
        include_fields:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Include Fields
          description: >-
            When specified, the server performs a projection to return only the
            fields specified by this list of JsonPaths (see RFC 9535) given as a
            list of strings.
        debug_info:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Debug Info
          description: >-
            When `True`, the server returns additional debug information (the
            embedding calculated for a vector or hybrid query) in the response.
          default: false
        include_element_embedding:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Include Element Embedding
          description: >-
            When `False`, and return_type is "element", the server does not
            return the embeddings of elements in the response.
          default: false
      additionalProperties: false
      type: object
      title: SearchRequest
    SearchResponse:
      properties:
        results:
          items: {}
          type: array
          title: Results
          description: >-
            The list of results returned by the query. These are Json objects
            representing the documents or elements that matched the query,
            possibly filtered by the optional projection specified by
            include_fields.
        query_embedding:
          anyOf:
            - items:
                type: number
              type: array
            - type: 'null'
          title: Query Embedding
          description: >-
            The embedding calculated for the query, if the query type is vector
            or hybrid and `debug_info` is True.
        next_page_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Page Token
          description: >-
            Reserved for future use. Will be a pagination token that can be used
            to retrieve the next page of results.
      type: object
      required:
        - results
      title: SearchResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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:
    HTTPBearer:
      type: http
      scheme: bearer

````