type : object
properties:
  indices:
    description: >-
      The names of the Elasticsearch indices in which to search. If none are provided, then all indices will be searched.
    externalDocs:
      description: Learn more about search indices here.
      url: https://documentation.sailpoint.com/saas/help/search/searchable-fields.html
    type: array
    items:
      $ref: 'Index.yaml'
    example:
    - 'identities'

  queryType:
    $ref: 'QueryType.yaml'

  queryVersion:
    allOf:
    - $ref: 'ElasticVersion.yaml'
    - type : string
      description: >-
        The version of the query object.

        This version number will map to the version of Elasticsearch for the query strings and objects being used.
  
  query:
    $ref: 'Query.yaml'

  queryDsl:
    description: >-
      The search query using the Elasticsearch [Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/query-dsl.html) syntax.
    type: object
    example:
      match:
        name: "john.doe"
    
  typeAheadQuery:
    $ref: 'TypeAheadQuery.yaml'

  includeNested:
    description: >-
      Indicates whether nested objects from returned search results should be included.
    type: boolean
    default: true
    example: true

  queryResultFilter:
    $ref: 'QueryResultFilter.yaml'

  aggregationType:
    $ref: 'aggregate/AggregationType.yaml'

  aggregationsVersion:
    allOf:
      - $ref: 'ElasticVersion.yaml'
      - type : string
        description: >-
          The version of the language being used for aggregation queries.

          This version number will map to the version of Elasticsearch for the aggregation query object.

  aggregationsDsl:
    description: >-
      The aggregation search query using Elasticsearch [Aggregations](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-aggregations.html) syntax.
    type: object
    example: {}

  aggregations:
    description: |
      The aggregation’s specifications, such as the groupings and calculations to be performed.
    $ref: 'aggregate/Aggregation.yaml'

  sort:
    description: >-
      The fields to be used to sort the search results.
      Use + or - to specify the sort direction.
    type: array
    items:
      type: string
      example: "+id"

  searchAfter:
    description: >-
      Used to begin the search window at the values specified.

      This parameter consists of the last values of the sorted fields in the current record set.

      This is used to expand the Elasticsearch limit of 10K records by shifting the 10K window to begin at this value.

      For example, when searching for identities, if the last idenitity ID in the search result is 2c91808375d8e80a0175e1f88a575221, then using that ID in this property will start a new search after this identity.
    type: array
    items:
      type: string
      example: "2c91808375d8e80a0175e1f88a575221"

  filters:
    description: >-
      The filters to be applied for each filtered field name.
    type: object
    additionalProperties:
      $ref: '../filter/Filter.yaml'
    example: {}
