openapi: 3.0.3
info:
  title: Couchbase Search Index Management and Monitoring API
  description: |-
    The Search Indexing REST API is provided by the Search service.
    This API enables you to manage and monitor your Search indexes.
  version: '8.0'
servers:
  - url: '{scheme}://{host}:{port}'
    description: The URL scheme, host, and port are as follows.
    variables:
      scheme:
        default: http
        description: |-
          The URL scheme.
          Use `https` for secure access.
        enum:
          - http
          - https
      host:
        default: localhost
        description: The host name or IP address of a node running the Search Service.
      port:
        default: '8094'
        description: |-
          The Search Service REST port.
          Use `18094` for secure access.
        enum:
          - '8094'
          - '18094'
tags:
  - name: Definitions
    x-displayName: Search Index Definitions
    description: Use the following APIs to retrieve Search index definitions, create new Search indexes, or delete an existing Search index.
  - name: Management
    x-displayName: Index Management
    description: Use the following endpoints to manage index controls, such as document ingestion, partition assignment, and queries.
  - name: Monitoring
    x-displayName: Index Monitoring and Debugging
    description: Use the following endpoints to get statistics about Search indexes for monitoring and debugging.
  - name: Querying
    x-displayName: Index Querying
    description: Use the following endpoints to query the contents of a Search index.
paths:
  /api/index:
    get:
      operationId: g-api-index
      summary: Get All Search Index Definitions
      description: Returns all Search index definitions from the bucket where you have read permissions, as a JSON object.
      tags:
        - Definitions
      responses:
        '200':
          description: A JSON object containing all Search index definitions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetIndexesResponse'
              example:
                indexDefs:
                  implVersion: 4.0.0
                  indexDefs:
                    myFirstIndex:
                      name: myFirstIndex
                      params: ''
                      planParams:
                        hierarchyRules: null
                        maxPartitionsPerPIndex: 0
                        nodePlanParams: null
                        numReplicas: 0
                        planFrozen: false
                      sourceName: ''
                      sourceParams: ''
                      sourceType: nil
                      sourceUUID: ''
                      type: fulltext-index
                      uuid: 6cc599ab7a85bf3b
                  uuid: 6cc599ab7a85bf3b
                status: ok
      security:
        - Read: []
  /api/bucket/{BUCKET_NAME}/scope/{SCOPE_NAME}/index:
    get:
      operationId: g-api-scoped-index
      summary: Get All Search Index Definitions (Scoped)
      description: Returns all Search index definitions inside the bucket and scope specified in the endpoint URL as a JSON object.
      tags:
        - Definitions
      parameters:
        - $ref: '#/components/parameters/PathBucket'
        - $ref: '#/components/parameters/PathScope'
      responses:
        '200':
          description: A JSON object containing all Search index definitions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetIndexesResponse'
              example:
                status: ok
                indexDefs:
                  uuid: 23cf9530131858b8
                  indexDefs:
                    travel-sample.inventory.travel-hotel:
                      type: fulltext-index
                      name: travel-hotel
                      uuid: a04a16f178846bc4
                      sourceType: gocbcore
                      sourceName: travel-sample
                      sourceUUID: 8f866261438f8b0d415a437552f3ae99
                      planParams:
                        maxPartitionsPerPIndex: 1024
                        indexPartitions: 1
                      params:
                        doc_config:
                          docid_prefix_delim: ''
                          docid_regexp: ''
                          mode: scope.collection.type_field
                          type_field: type
                        mapping:
                          analysis: {}
                          default_analyzer: standard
                          default_datetime_parser: dateTimeOptional
                          default_field: _all
                          default_mapping:
                            dynamic: true
                            enabled: false
                          default_type: _default
                          docvalues_dynamic: false
                          index_dynamic: true
                          store_dynamic: false
                          type_field: _type
                          types:
                            inventory.hotel:
                              dynamic: false
                              enabled: true
                              properties:
                                reviews:
                                  dynamic: false
                                  enabled: true
                                  properties:
                                    content:
                                      dynamic: false
                                      enabled: true
                                      fields:
                                        - docvalues: true
                                          include_in_all: true
                                          include_term_vectors: true
                                          index: true
                                          name: content
                                          store: true
                                          type: text
                        store:
                          indexType: scorch
                          segmentVersion: 15
                      sourceParams: {}
                    travel-sample.inventory.travel-test:
                      type: fulltext-index
                      name: travel-test
                      uuid: 766ddce5d41a3b41
                      sourceType: gocbcore
                      sourceName: travel-sample
                      sourceUUID: 8f866261438f8b0d415a437552f3ae99
                      planParams:
                        maxPartitionsPerPIndex: 1024
                        indexPartitions: 1
                      params:
                        doc_config:
                          docid_prefix_delim: ''
                          docid_regexp: ''
                          mode: scope.collection.type_field
                          type_field: type
                        mapping:
                          analysis: {}
                          default_analyzer: standard
                          default_datetime_parser: dateTimeOptional
                          default_field: _all
                          default_mapping:
                            dynamic: true
                            enabled: true
                          default_type: _default
                          docvalues_dynamic: false
                          index_dynamic: true
                          store_dynamic: false
                          type_field: _type
                        store:
                          indexType: scorch
                          segmentVersion: 15
                      sourceParams: {}
                  implVersion: 5.7.0
      security:
        - Read: []
  /api/index/{INDEX_NAME}:
    get:
      operationId: g-api-index-name
      summary: Get Index Definition
      description: Returns the definition of the Search index specified in the endpoint URL as a JSON object.
      tags:
        - Definitions
      parameters:
        - $ref: '#/components/parameters/PathIndexFull'
      responses:
        '200':
          description: A JSON object containing the Search index definition.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetIndexResponse'
              example:
                indexDef:
                  name: myFirstIndex
                  params: ''
                  planParams:
                    hierarchyRules: null
                    maxPartitionsPerPIndex: 0
                    nodePlanParams: null
                    numReplicas: 0
                    planFrozen: false
                  sourceName: ''
                  sourceParams: ''
                  source: nil
                  sourceUUID: ''
                  type: fulltext-index
                  uuid: 6cc599ab7a85bf3b
                planPIndexes:
                  - indexName: myFirstIndex
                    indexParams: ''
                    indexType: bleve
                    indexUUID: 6cc599ab7a85bf3b
                    name: myFirstIndex_6cc599ab7a85bf3b_0
                    nodes:
                      78fc2ffac2fd9401:
                        canRead: true
                        canWrite: true
                        priority: 0
                    sourceName: ''
                    sourceParams: ''
                    sourcePartitions: ''
                    sourceType: nil
                    sourceUUID: ''
                    uuid: 64bed6e2edf354c3
                status: ok
                warnings: []
      security:
        - Read: []
    delete:
      operationId: d-api-index-name
      summary: Delete Index Definition
      description: Deletes the Search index definition specified in the endpoint URL.
      tags:
        - Definitions
      parameters:
        - $ref: '#/components/parameters/PathIndexFull'
      responses:
        '200':
          description: The Search Service returns a response that includes the status `ok`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteIndexResponse'
              example:
                status: ok
                uuid: 123294e5a4efbe39
        default:
          description: The Search Service returns a non-200 HTTP error code when a request fails.
          content:
            application/json:
              schema:
                type: object
              example:
                error: 'rest_auth: preparePerms, err: index not found'
                request: ''
                status: fail
      security:
        - Write: []
    put:
      operationId: p-api-index-name
      summary: Create or Update an Index Definition
      description: |-
        If the Search index in the endpoint URL does not exist, this endpoint uses a JSON object in the request body to create a new index.
        If the Search index already exists, this endpoint updates the Search index definition.
      tags:
        - Definitions
      parameters:
        - $ref: '#/components/parameters/PathIndexFull'
      requestBody:
        required: true
        description: |-
          The full Search index definition.
          For a detailed list of all parameters for the request body, see [Search Index JSON Properties](../search/search-index-params.html).
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IndexDefinition'
      responses:
        '200':
          description: A JSON object indicating the status of the operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PutIndexResponse'
              example:
                status: ok
                name: travel-test
                uuid: 565ca041af3baf9d
        default:
          description: The Search Service returns a non-200 HTTP error code when a request fails.
          content:
            application/json:
              schema:
                type: object
              example:
                error: 'rest_create_index: index type is required, indexName: travel-test'
                request: ''
                status: fail
      security:
        - Write: []
  /api/bucket/{BUCKET_NAME}/scope/{SCOPE_NAME}/index/{INDEX_NAME}:
    get:
      operationId: g-api-scoped-index-name
      summary: Get Index Definition (Scoped)
      description: |-
        Returns the Search index definition for the Search index specified in the endpoint URL as a JSON object.
        This endpoint is scoped and does not require a fully qualified `{INDEX_NAME}` value.
      tags:
        - Definitions
      parameters:
        - $ref: '#/components/parameters/PathBucket'
        - $ref: '#/components/parameters/PathScope'
        - $ref: '#/components/parameters/PathIndex'
      responses:
        '200':
          description: A JSON object containing the Search index definition.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetIndexResponse'
              example:
                status: ok
                indexDef:
                  type: fulltext-index
                  name: color-test
                  uuid: 6ea521a918bd3837
                  sourceType: gocbcore
                  sourceName: vector-sample
                  sourceUUID: 614177a67bdfbd2823c5f9c3e62f5991
                  planParams:
                    maxPartitionsPerPIndex: 1024
                    indexPartitions: 1
                  params:
                    doc_config:
                      docid_prefix_delim: ''
                      docid_regexp: ''
                      mode: scope.collection.type_field
                      type_field: type
                    mapping:
                      analysis: {}
                      default_analyzer: standard
                      default_datetime_parser: dateTimeOptional
                      default_field: _all
                      default_mapping:
                        dynamic: false
                        enabled: false
                      default_type: _default
                      docvalues_dynamic: false
                      index_dynamic: false
                      store_dynamic: false
                      type_field: _type
                      types:
                        color.rgb:
                          dynamic: false
                          enabled: true
                          properties:
                            color:
                              dynamic: false
                              enabled: true
                              fields:
                                - analyzer: en
                                  docvalues: true
                                  include_in_all: true
                                  include_term_vectors: true
                                  index: true
                                  name: color
                                  store: true
                                  type: text
                            colorvect_dot:
                              dynamic: false
                              enabled: true
                              fields:
                                - dims: 3
                                  index: true
                                  name: colorvect_dot
                                  similarity: dot_product
                                  type: vector
                                  vector_index_optimized_for: recall
                    store:
                      indexType: scorch
                      segmentVersion: 16
                  sourceParams: {}
                planPIndexes:
                  - name: vector-sample.color.color-test_6ea521a918bd3837_4c1c5584
                    uuid: '1543820346544e08'
                    indexType: fulltext-index
                    indexName: vector-sample.color.color-test
                    indexUUID: 6ea521a918bd3837
                    sourceType: gocbcore
                    sourceName: vector-sample
                    sourceUUID: 614177a67bdfbd2823c5f9c3e62f5991
                    sourcePartitions: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023
                    nodes:
                      b7d460b7d4145482ac132dfa23727c5c:
                        canRead: true
                        canWrite: true
                        priority: 0
                    indexParams:
                      doc_config:
                        docid_prefix_delim: ''
                        docid_regexp: ''
                        mode: scope.collection.type_field
                        type_field: type
                      mapping:
                        analysis: {}
                        default_analyzer: standard
                        default_datetime_parser: dateTimeOptional
                        default_field: _all
                        default_mapping:
                          dynamic: false
                          enabled: false
                        default_type: _default
                        docvalues_dynamic: false
                        index_dynamic: false
                        store_dynamic: false
                        type_field: _type
                        types:
                          color.rgb:
                            dynamic: false
                            enabled: true
                            properties:
                              color:
                                dynamic: false
                                enabled: true
                                fields:
                                  - analyzer: en
                                    docvalues: true
                                    include_in_all: true
                                    include_term_vectors: true
                                    index: true
                                    name: color
                                    store: true
                                    type: text
                              colorvect_dot:
                                dynamic: false
                                enabled: true
                                fields:
                                  - dims: 3
                                    index: true
                                    name: colorvect_dot
                                    similarity: dot_product
                                    type: vector
                                    vector_index_optimized_for: recall
                      store:
                        indexType: scorch
                        segmentVersion: 16
                warnings: []
      security:
        - Read: []
    put:
      operationId: p-api-scoped-index-name
      summary: Create or Update an Index Definition (Scoped)
      description: |-
        If the Search index in the endpoint URL does not exist, this endpoint uses a JSON object in the request body to create a new index.
        If the Search index already exists, this endpoint updates the Search index definition.
        This endpoint is scoped and does not require a fully qualified `{INDEX_NAME}` value.
      tags:
        - Definitions
      parameters:
        - $ref: '#/components/parameters/PathBucket'
        - $ref: '#/components/parameters/PathScope'
        - $ref: '#/components/parameters/PathIndex'
      requestBody:
        required: true
        description: |-
          The full Search index definition.
          For a detailed list of all parameters for the request body, see [Search Index JSON Properties](../search/search-index-params.html).
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IndexDefinition'
      responses:
        '200':
          description: A JSON object indicating the status of the operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PutIndexResponse'
              example:
                status: ok
                name: travel-sample.inventory.travel-test
                uuid: 654cb62baebf2d26
        default:
          description: The Search Service returns a non-200 HTTP error code when a request fails.
          content:
            application/json:
              schema:
                type: object
              example:
                error: 'rest_create_index: index type is required, indexName: travel-test'
                request: {}
                status: fail
      security:
        - Write: []
    delete:
      operationId: d-api-scoped-index-name
      summary: Delete Index Definition (Scoped)
      description: |-
        Delete the Search index definition from the bucket and scope specified in the endpoint URL.
        This endpoint is scoped and does not require a fully qualified `{INDEX_NAME}` value.
      tags:
        - Definitions
      parameters:
        - $ref: '#/components/parameters/PathBucket'
        - $ref: '#/components/parameters/PathScope'
        - $ref: '#/components/parameters/PathIndex'
      responses:
        '200':
          description: A JSON object indicating the status of the operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteIndexResponse'
              example:
                status: ok
                uuid: 687be6a2ad647c34
        default:
          description: The Search Service returns a non-200 HTTP error code when a request fails.
          content:
            application/json:
              schema:
                type: object
              example:
                error: 'rest_auth: preparePerms, err: index not found'
                request: ''
                status: fail
      security:
        - Write: []
  /api/index/{INDEX_NAME}/ingestControl/{OP}:
    post:
      operationId: p-api-idx-name-ingestcontrol
      summary: Set Index Ingestion Control
      description: |-
        For the Search index specified in the endpoint URL, pause or resume index updates and maintenance.
        While paused, the Search index does not load any new document mutations.
      tags:
        - Management
      parameters:
        - $ref: '#/components/parameters/PathIndexFull'
        - $ref: '#/components/parameters/PathOpIngest'
      responses:
        '200':
          $ref: '#/components/responses/OK'
      security:
        - Manage: []
  /api/bucket/{BUCKET_NAME}/scope/{SCOPE_NAME}/index/{INDEX_NAME}/ingestControl/{OP}:
    post:
      operationId: p-api-scoped-ingestcontrol
      summary: Set Index Ingestion Control (Scoped)
      description: |-
        For the Search index specified in the endpoint URL, pause or resume index updates and maintenance.
        While paused, the Search index does not load any new document mutations.
        This endpoint is scoped and does not require a fully qualified `{INDEX_NAME}` value.
      tags:
        - Management
      parameters:
        - $ref: '#/components/parameters/PathBucket'
        - $ref: '#/components/parameters/PathScope'
        - $ref: '#/components/parameters/PathIndex'
        - $ref: '#/components/parameters/PathOpIngest'
      responses:
        '200':
          $ref: '#/components/responses/OK'
      security:
        - Manage: []
  /api/index/{INDEX_NAME}/planFreezeControl/{OP}:
    post:
      operationId: p-api-idx-name-planfreezecontrol
      summary: Freeze Index Partition Assignment
      description: |-
        For the Search index specified in the endpoint URL, freeze or unfreeze the assignment of index partitions to nodes.
        While frozen, the Search index stops assigning partitions during index rebalancing and index definition updates.
      tags:
        - Management
      parameters:
        - $ref: '#/components/parameters/PathIndexFull'
        - $ref: '#/components/parameters/PathOpPartition'
      responses:
        '200':
          $ref: '#/components/responses/OK'
      security:
        - Manage: []
  /api/bucket/{BUCKET_NAME}/scope/{SCOPE_NAME}/index/{INDEX_NAME}/planFreezeControl/{OP}:
    post:
      operationId: p-api-scoped-planfreezecontrol
      summary: Freeze Index Partition Assignment (Scoped)
      description: |-
        For the Search index specified in the endpoint URL, freeze or unfreeze the assignment of index partitions to nodes.
        While frozen, the Search index stops assigning partitions during index rebalancing and index definition updates.
        This endpoint is scoped and does not require a fully qualified `{INDEX_NAME}` value.
      tags:
        - Management
      parameters:
        - $ref: '#/components/parameters/PathBucket'
        - $ref: '#/components/parameters/PathScope'
        - $ref: '#/components/parameters/PathIndex'
        - $ref: '#/components/parameters/PathOpPartition'
      responses:
        '200':
          $ref: '#/components/responses/OK'
      security:
        - Manage: []
  /api/index/{INDEX_NAME}/queryControl/{OP}:
    post:
      operationId: p-api-idx-name-querycontrol
      summary: Stop Queries on an Index
      description: |-
        For the Search index specified in the endpoint URL, disallow or allow queries.
        While queries are disallowed, users see an error that the Search index's partitions could not be reached.
      tags:
        - Management
      parameters:
        - $ref: '#/components/parameters/PathIndexFull'
        - $ref: '#/components/parameters/PathOpQuery'
      responses:
        '200':
          $ref: '#/components/responses/OK'
      security:
        - Manage: []
  /api/bucket/{BUCKET_NAME}/scope/{SCOPE_NAME}/index/{INDEX_NAME}/queryControl/{OP}:
    post:
      operationId: p-api-scoped-querycontrol
      summary: Stop Queries on an Index (Scoped)
      description: |-
        For the Search index specified in the endpoint URL, disallow or allow queries.
        While queries are disallowed, users see an error that the Search index's partitions could not be reached.
        This endpoint is scoped and does not require a fully qualified `{INDEX_NAME}` value.
      tags:
        - Management
      parameters:
        - $ref: '#/components/parameters/PathBucket'
        - $ref: '#/components/parameters/PathScope'
        - $ref: '#/components/parameters/PathIndex'
        - $ref: '#/components/parameters/PathOpQuery'
      responses:
        '200':
          $ref: '#/components/responses/OK'
      security:
        - Manage: []
  /api/stats:
    get:
      operationId: g-api-stats
      summary: Get Indexing and Data Metrics for All Indexes
      description: |-
        Returns indexing and data-related metrics, timings, counters, and detailed partition information for all Search indexes, from the node running the Search Service.

        This endpoint returns statistics provided by the Search service.
        For additional statistics, see [Get Query, Mutation, and Partition Statistics for the Search Service](../fts-rest-stats/index.html#g-api-nsstats).
      tags:
        - Monitoring
      responses:
        '200':
          description: A JSON object containing indexing and data metrics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsNodeResponse'
              example:
                feeds:
                  myFirstIndex_6cc599ab7a85bf3b: {}
                manager:
                  TotCreateIndex: 1
                  TotCreateIndexOk: 1
                  TotDeleteIndex: 0
                  TotDeleteIndexOk: 0
                  TotIndexControl: 0
                  TotIndexControlOk: 0
                  TotJanitorClosePIndex: 0
                  TotJanitorKick: 2
                  TotJanitorKickErr: 0
                  TotJanitorKickOk: 2
                  TotJanitorKickStart: 2
                  TotJanitorNOOP: 0
                  TotJanitorNOOPOk: 0
                  TotJanitorRemovePIndex: 0
                  TotJanitorSubscriptionEvent: 0
                  TotJanitorUnknownErr: 0
                  TotKick: 0
                  TotPlannerKick: 2
                  TotPlannerKickChanged: 1
                  TotPlannerKickErr: 0
                  TotPlannerKickOk: 2
                  TotPlannerKickStart: 2
                  TotPlannerNOOP: 0
                  TotPlannerNOOPOk: 0
                  TotPlannerSubscriptionEvent: 0
                  TotPlannerUnknownErr: 0
                  TotSaveNodeDef: 2
                  TotSaveNodeDefGetErr: 0
                  TotSaveNodeDefOk: 2
                  TotSaveNodeDefSame: 0
                  TotSaveNodeDefSetErr: 0
                pindexes:
                  myFirstIndex_6cc599ab7a85bf3b_0: null
      security:
        - Statistics: []
  /api/stats/index/{INDEX_NAME}:
    get:
      operationId: g-api-stats-index-name
      summary: Get Indexing and Data Metrics for an Index
      description: |-
        Returns indexing and data-related metrics, timings, counters, and detailed partition information for the Search index specified in the endpoint URL.

        This endpoint returns statistics provided by the Search service.
        For additional statistics, see [Get Query, Mutation, and Partition Statistics for an Index](../fts-rest-stats/index.html#g-api-nsstats-index-name).
      tags:
        - Monitoring
      parameters:
        - $ref: '#/components/parameters/PathIndexFull'
      responses:
        '200':
          description: A JSON object containing statistics for the specified Search index.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsIndexResponse'
              example:
                feeds: {}
                pindexes:
                  travel-sample.inventory.travel-test_3858c70e4d4d8df9_4c1c5584:
                    pindexStoreStats:
                      TimerBatchStore:
                        count: 0
                        min: 0
                        max: 0
                        mean: 0
                        stddev: 0
                        percentiles:
                          99%: 0
                          99.9%: 0
                          median: 0
                          75%: 0
                          95%: 0
                        rates:
                          mean: 0
                          1-min: 0
                          5-min: 0
                          15-min: 0
                      Errors: []
                    bleveIndexStats:
                      index:
                        CurFilesIneligibleForRemoval: 0
                        CurOnDiskBytes: 34007668
                        CurOnDiskFiles: 4
                        CurRootEpoch: 0
                        LastMergedEpoch: 44
                        LastPersistedEpoch: 44
                        MaxBatchIntroTime: 0
                        MaxFileMergeZapIntroductionTime: 0
                        MaxFileMergeZapTime: 0
                        MaxMemMergeZapTime: 0
                        TotAnalysisTime: 0
                        TotBatchIntroTime: 0
                        TotBatches: 0
                        TotBatchesEmpty: 0
                        TotBytesReadAtQueryTime: 294892
                        TotBytesWrittenAtIndexTime: 0
                        TotDeletes: 0
                        TotEventTriggerCompleted: 2
                        TotEventTriggerStarted: 2
                        TotFileMergeForceOpsCompleted: 0
                        TotFileMergeForceOpsStarted: 0
                        TotFileMergeIntroductions: 0
                        TotFileMergeIntroductionsDone: 0
                        TotFileMergeIntroductionsObsoleted: 0
                        TotFileMergeIntroductionsSkipped: 0
                        TotFileMergeLoopBeg: 2
                        TotFileMergeLoopEnd: 1
                        TotFileMergeLoopErr: 0
                        TotFileMergePlan: 1
                        TotFileMergePlanErr: 0
                        TotFileMergePlanNone: 1
                        TotFileMergePlanOk: 0
                        TotFileMergePlanTasks: 0
                        TotFileMergePlanTasksDone: 0
                        TotFileMergePlanTasksErr: 0
                        TotFileMergePlanTasksSegments: 0
                        TotFileMergePlanTasksSegmentsEmpty: 0
                        TotFileMergeSegments: 0
                        TotFileMergeSegmentsEmpty: 0
                        TotFileMergeWrittenBytes: 0
                        TotFileMergeZapBeg: 0
                        TotFileMergeZapEnd: 0
                        TotFileMergeZapIntroductionTime: 0
                        TotFileMergeZapTime: 0
                        TotFileSegmentsAtRoot: 1
                        TotIndexTime: 0
                        TotIndexedPlainTextBytes: 0
                        TotIntroduceLoop: 3
                        TotIntroduceMergeBeg: 0
                        TotIntroduceMergeEnd: 0
                        TotIntroducePersistBeg: 0
                        TotIntroducePersistEnd: 0
                        TotIntroduceRevertBeg: 0
                        TotIntroduceRevertEnd: 0
                        TotIntroduceSegmentBeg: 0
                        TotIntroduceSegmentEnd: 0
                        TotIntroducedItems: 0
                        TotIntroducedSegmentsBatch: 0
                        TotIntroducedSegmentsMerge: 0
                        TotItemsToPersist: 0
                        TotMemMergeBeg: 0
                        TotMemMergeDone: 0
                        TotMemMergeErr: 0
                        TotMemMergeSegments: 0
                        TotMemMergeZapBeg: 0
                        TotMemMergeZapEnd: 0
                        TotMemMergeZapTime: 0
                        TotMemorySegmentsAtRoot: 0
                        TotOnErrors: 0
                        TotPersistLoopBeg: 2
                        TotPersistLoopEnd: 1
                        TotPersistLoopErr: 0
                        TotPersistLoopProgress: 0
                        TotPersistLoopWait: 2
                        TotPersistLoopWaitNotified: 0
                        TotPersistedItems: 0
                        TotPersistedSegments: 0
                        TotPersisterMergerNapBreak: 1
                        TotPersisterNapPauseCompleted: 1
                        TotPersisterSlowMergerPause: 0
                        TotPersisterSlowMergerResume: 0
                        TotSnapshotsRemovedFromMetaStore: 0
                        TotTermSearchersFinished: 13
                        TotTermSearchersStarted: 13
                        TotUpdates: 0
                        analysis_time: 0
                        batches: 0
                        deletes: 0
                        errors: 0
                        index_time: 0
                        num_bytes_read_at_query_time: 294892
                        num_bytes_used_disk: 34007668
                        num_bytes_used_disk_by_root: 15644303
                        num_bytes_used_disk_by_root_reclaimable: 0
                        num_bytes_written_at_index_time: 0
                        num_files_on_disk: 4
                        num_items_introduced: 0
                        num_items_persisted: 0
                        num_persister_nap_merger_break: 1
                        num_persister_nap_pause_completed: 1
                        num_plain_text_bytes_indexed: 0
                        num_recs_to_persist: 0
                        num_root_filesegments: 1
                        num_root_memorysegments: 0
                        term_searchers_finished: 13
                        term_searchers_started: 13
                        total_compaction_written_bytes: 0
                        updates: 0
                      search_time: 40353204
                      searches: 1
                    basic:
                      DocCount: 917
                    partitions: {}
                    copyPartitionStats:
                      TotCopyPartitionStart: 0
                      TotCopyPartitionFinished: 0
                      TotCopyPartitionTimeInMs: 0
                      TotCopyPartitionFailed: 0
                      TotCopyPartitionRetries: 0
                      TotCopyPartitionErrors: 0
                      TotCopyPartitionSkipped: 0
                      TotCopyPartitionCancelled: 0
                      TotCopyPartitionOnHttp2: 0
      security:
        - Statistics: []
  /api/bucket/{BUCKET_NAME}/scope/{SCOPE_NAME}/index/{INDEX_NAME}/status:
    get:
      operationId: g-api-scoped-status
      summary: Get Index Status (Scoped)
      description: |
        Returns the status of the Search index specified in the endpoint URL, including whether all index partitions are created and ready to use.
      tags:
        - Monitoring
      parameters:
        - $ref: '#/components/parameters/PathBucket'
        - $ref: '#/components/parameters/PathScope'
        - $ref: '#/components/parameters/PathIndex'
      responses:
        '200':
          description: The Search Service returns a response that includes the status `ok`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusResponse'
              example:
                status: ok
                indexStatus: Ready
      security:
        - Read: []
  /api/index/{INDEX_NAME}/analyzeDoc:
    post:
      operationId: g-api-stats-index-name-analyzeDoc
      summary: Analyze Document
      description: |
        Use the Search index specified in the endpoint URL to analyze a document from the request body.
      tags:
        - Monitoring
      parameters:
        - $ref: '#/components/parameters/PathIndexFull'
      requestBody:
        required: true
        description: Add any valid JSON document to the request body.
        content:
          application/json:
            schema:
              type: object
              title: Request Body
            example:
              name: hello world
              title: couchbase blr
      responses:
        '200':
          description: A JSON object containing the analysis of the provided document.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentAnalysis'
              example:
                status: ok
                analyzed:
                  - couchbase blr:
                      Term: Y291Y2hiYXNlIGJscg==
                      Locations:
                        - Field: title
                          ArrayPositions: []
                          Start: 0
                          End: 13
                          Position: 1
                  - he:
                      Term: aGU=
                      Locations:
                        - Field: name
                          ArrayPositions: []
                          Start: 0
                          End: 5
                          Position: 1
                    hel:
                      Term: aGVs
                      Locations:
                        - Field: name
                          ArrayPositions: []
                          Start: 0
                          End: 5
                          Position: 1
                    hell:
                      Term: aGVsbA==
                      Locations:
                        - Field: name
                          ArrayPositions: []
                          Start: 0
                          End: 5
                          Position: 1
                    hello:
                      Term: aGVsbG8=
                      Locations:
                        - Field: name
                          ArrayPositions: []
                          Start: 0
                          End: 5
                          Position: 1
                    wo:
                      Term: d28=
                      Locations:
                        - Field: name
                          ArrayPositions: []
                          Start: 6
                          End: 11
                          Position: 2
                    wor:
                      Term: d29y
                      Locations:
                        - Field: name
                          ArrayPositions: []
                          Start: 6
                          End: 11
                          Position: 2
                    worl:
                      Term: d29ybA==
                      Locations:
                        - Field: name
                          ArrayPositions: []
                          Start: 6
                          End: 11
                          Position: 2
                    world:
                      Term: d29ybGQ=
                      Locations:
                        - Field: name
                          ArrayPositions: []
                          Start: 6
                          End: 11
                          Position: 2
                  - null
      security:
        - Read: []
  /api/index/{INDEX_NAME}/count:
    get:
      operationId: g-api-index-name-count
      summary: Get Document Count for an Index
      description: |
        Returns the number of documents indexed in the specified Search index.
      tags:
        - Querying
      parameters:
        - $ref: '#/components/parameters/PathIndexFull'
      responses:
        '200':
          description: The Search Service returns a response that includes the status `ok`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentCount'
              example:
                status: ok
                count: 285
      security:
        - Statistics: []
  /api/bucket/{BUCKET_NAME}/scope/{SCOPE_NAME}/index/{INDEX_NAME}/pindexLookup:
    post:
      operationId: p-api-pindex-lookup
      summary: Look Up the Index Partition for a Document (Scoped)
      description: |
        Send a document ID in the request body and return the Search index partition ID where the document is stored.
        The endpoint returns a JSON object as a response.
      tags:
        - Querying
      parameters:
        - $ref: '#/components/parameters/PathBucket'
        - $ref: '#/components/parameters/PathScope'
        - $ref: '#/components/parameters/PathIndex'
      requestBody:
        required: true
        description: A valid JSON object that contains the docID property, with a value that matches the document ID for a document in the Search index.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LookupRequest'
            example:
              docID: hotel_5848
      responses:
        '200':
          description: The Search Service returns a response that includes the status `ok`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LookupResponse'
              example:
                status: ok
                pindexes:
                  travel-sample.inventory.travel-test:
                    id: travel-sample.inventory.travel-test_123294e5a4efbe39_4c1c5584
      security:
        - Manage: []
  /api/index/{INDEX_NAME}/query:
    post:
      operationId: p-api-index-name-query
      summary: Query a Search Index
      description: |
        Run a query formatted as a JSON object against the Search index definition specified in the endpoint URL.
        The endpoint returns a JSON object as a response.
      tags:
        - Querying
      parameters:
        - $ref: '#/components/parameters/PathIndexFull'
      requestBody:
        required: true
        description: |-
          A JSON object to define the settings for your Search query.
          For more information about how to create a Search query JSON object, see [Search Request JSON Properties](../search/search-request-params.html).
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryRequest'
            examples:
              regular:
                summary: Regular Query
                value:
                  query:
                    query: a sample query
                    boost: 1
                  size: 10
                  from: 0
                  highlight: null
                  fields: null
                  facets: null
                  explain: false
              options:
                summary: Query with Options
                value:
                  ctl:
                    timeout: 10000
                    consistency:
                      level: at_plus
                      vectors:
                        customerIndex:
                          '0': 123
                          1/a0b1c2: 234
                  query:
                    query: alice smith
                    boost: 1
                  size: 10
                  from: 20
                  highlight:
                    style: null
                    fields: null
                  fields:
                    - '*'
                  facets: null
                  explain: true
              hybrid:
                summary: Hybrid Query
                value:
                  fields:
                    - '*'
                  query:
                    min: 70
                    max: 80
                    inclusive_min: false
                    inclusive_max: true
                    field: brightness
                  knn:
                    - k: 10
                      field: colorvect_dot
                      vector:
                        - 0.707106781186548
                        - 0
                        - 0.707106781186548
                  size: 10
      responses:
        '200':
          description: |-
            The response object has a status section that must be checked for every request.
            Under nearly all circumstances, the query response will be HTTP 200 even though individual index shards (partitions) may encounter a timeout or return an error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryResponse'
      security:
        - Manage: []
  /api/bucket/{BUCKET_NAME}/scope/{SCOPE_NAME}/index/{INDEX_NAME}/query:
    post:
      operationId: p-api-scoped-query
      summary: Query a Search Index (Scoped)
      description: |
        Run a query formatted as a JSON object against the Search index definition specified in the endpoint URL.
        The endpoint returns a JSON object as a response.
        This endpoint is scoped and does not require a fully qualified `{INDEX_NAME}` value.
      tags:
        - Querying
      parameters:
        - $ref: '#/components/parameters/PathBucket'
        - $ref: '#/components/parameters/PathScope'
        - $ref: '#/components/parameters/PathIndex'
      requestBody:
        required: true
        description: |-
          A JSON object to define the settings for your Search query.
          For more information about how to create a Search query JSON object, see [Search Request JSON Properties](../search/search-request-params.html).
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryRequest'
      responses:
        '200':
          description: |-
            The response object has a status section that must be checked for every request.
            Under nearly all circumstances, the query response will be HTTP 200 even though individual index shards (partitions) may encounter a timeout or return an error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryResponse'
              examples:
                regular:
                  summary: Success Response for a Regular Query
                  value:
                    status:
                      total: 1
                      failed: 0
                      successful: 1
                    request:
                      query:
                        conjuncts:
                          - match: location
                            field: reviews.content
                            prefix_length: 0
                            fuzziness: 0
                            operator: or
                          - match_phrase: nice view
                            field: reviews.content
                      size: 10
                      from: 0
                      highlight:
                        style: html
                        fields:
                          - reviews.content
                      fields: null
                      facets: null
                      explain: true
                      sort:
                        - reviews.Ratings.Cleanliness
                        - by: field
                          field: reviews.Ratings.Cleanliness
                          type: number
                        - '-_score'
                        - '-_id'
                      includeLocations: false
                      score: none
                      search_after: null
                      search_before: null
                    hits:
                      - index: travel-sample.inventory.travel-test_53373d2948c55e82_4c1c5584
                        id: hotel_7388
                        score: 0
                        explanation:
                          value: 0
                          message: 'sum of:'
                          children:
                            - value: 0
                              message: 'product of:'
                              children:
                                - value: 0
                                  message: 'sum of:'
                                  children:
                                    - value: 0
                                      message: "weight(reviews.content:location^1.000000 in \0\0\0\0\0\0\x03\n), product of:"
                                      children:
                                        - value: 0.5320504947307548
                                          message: 'queryWeight(reviews.content:location^1.000000), product of:'
                                          children:
                                            - value: 1
                                              message: boost
                                            - value: 1.4291903588638628
                                              message: idf(docFreq=596, maxDocs=917)
                                            - value: 0.3722740581273647
                                              message: queryNorm
                                        - value: 0
                                          message: "fieldWeight(reviews.content:location in \0\0\0\0\0\0\x03\n), product of:"
                                          children:
                                            - value: 0
                                              message: tf(termFreq(reviews.content:location)=0
                                            - value: 0
                                              message: "fieldNorm(field=reviews.content, doc=\0\0\0\0\0\0\x03\n)"
                                            - value: 1.4291903588638628
                                              message: idf(docFreq=596, maxDocs=917)
                                - value: 1
                                  message: coord(1/1)
                            - value: 0
                              message: 'sum of:'
                              children:
                                - value: 0
                                  message: "weight(reviews.content:view^1.000000 in \0\0\0\0\0\0\x03\n), product of:"
                                  children:
                                    - value: 0.6867550119496617
                                      message: 'queryWeight(reviews.content:view^1.000000), product of:'
                                      children:
                                        - value: 1
                                          message: boost
                                        - value: 1.8447565629585312
                                          message: idf(docFreq=393, maxDocs=917)
                                        - value: 0.3722740581273647
                                          message: queryNorm
                                    - value: 0
                                      message: "fieldWeight(reviews.content:view in \0\0\0\0\0\0\x03\n), product of:"
                                      children:
                                        - value: 0
                                          message: tf(termFreq(reviews.content:view)=0
                                        - value: 0
                                          message: "fieldNorm(field=reviews.content, doc=\0\0\0\0\0\0\x03\n)"
                                        - value: 1.8447565629585312
                                          message: idf(docFreq=393, maxDocs=917)
                                - value: 0
                                  message: "weight(reviews.content:nice^1.000000 in \0\0\0\0\0\0\x03\n), product of:"
                                  children:
                                    - value: 0.4952674273751292
                                      message: 'queryWeight(reviews.content:nice^1.000000), product of:'
                                      children:
                                        - value: 1
                                          message: boost
                                        - value: 1.3303839377539577
                                          message: idf(docFreq=658, maxDocs=917)
                                        - value: 0.3722740581273647
                                          message: queryNorm
                                    - value: 0
                                      message: "fieldWeight(reviews.content:nice in \0\0\0\0\0\0\x03\n), product of:"
                                      children:
                                        - value: 0
                                          message: tf(termFreq(reviews.content:nice)=0
                                        - value: 0
                                          message: "fieldNorm(field=reviews.content, doc=\0\0\0\0\0\0\x03\n)"
                                        - value: 1.3303839377539577
                                          message: idf(docFreq=658, maxDocs=917)
                        locations:
                          reviews.content:
                            location:
                              - pos: 312
                                start: 1641
                                end: 1649
                                array_positions:
                                  - 4
                            nice:
                              - pos: 165
                                start: 840
                                end: 844
                                array_positions:
                                  - 2
                            view:
                              - pos: 166
                                start: 845
                                end: 849
                                array_positions:
                                  - 2
                        fragments:
                          reviews.content:
                            - …at&#39;s her name checked us in, very friendly and knowlegeable of the area. I would stay here again get area and right at the street car stop. nice resturants in walking distance. <mark>nice</mark> <mark>view</mark> of the city o…
                        sort:
                          - 􏿿􏿿􏿿
                          - 􏿿􏿿􏿿
                          - _score
                          - hotel_7388
                      - ...
                    total_hits: 27
                    cost: 108906
                    max_score: 0
                    took: 14964461
                    facets: null
                hybrid:
                  summary: Success Response for a Hybrid Query
                  value:
                    status:
                      total: 1
                      failed: 0
                      successful: 1
                    request:
                      fields:
                        - '*'
                      query:
                        match_none: ''
                      knn:
                        - k: 2
                          field: colorvect_dot
                          vector:
                            - 0.707106781186548
                            - 0
                            - 0.707106781186548
                    hits:
                      - index: vector-sample.color.color-test_4d6a4a2f00f48fa2_4c1c5584
                        id: '#FF00FF'
                        score: 0.9999999403953552
                        sort:
                          - _score
                        fields:
                          color: magenta / fuchsia
                      - index: vector-sample.color.color-test_4d6a4a2f00f48fa2_4c1c5584
                        id: '#B000B0'
                        score: 0.9999999403953552
                        sort:
                          - _score
                        fields:
                          color: dark lavender
                    total_hits: 2
                    cost: 0
                    max_score: 0.9999999403953552
                    took: 4608572
                    facets: null
        default:
          description: The Search Service returns a non-200 HTTP error code when a request fails.
          content:
            application/json:
              example:
                error: 'rest_index: Query, indexName: travel-sample.inventory.travel-test, err: bleve: QueryBleve parsing searchRequest, err: unknown query type'
                request:
                  collections:
                    - hotel
                  ctl:
                    consistency:
                      level: at_plus
                      results: complete
                      vectors:
                        searchIndexName:
                          607/205096593892159: 2
                          640/298739127912798: 4
                    timeout: 10000
                  explain: true
                  from: 0
                  highlight:
                    fields:
                      - reviews.content
                    style: html
                  includeLocations: false
                  limit: 10
                  offset: 0
                  query: {}
                  score: none
                  size: 10
                  sort:
                    - reviews.Ratings.Cleanliness
                    - by: field
                      desc: false
                      field: reviews.Ratings.Cleanliness
                      missing: last
                      mode: default
                      type: number
                    - '-_score'
                    - '-_id'
                status: fail
      security:
        - Manage: []
components:
  parameters:
    PathBucket:
      name: BUCKET_NAME
      in: path
      required: true
      schema:
        type: string
      description: The name of the bucket containing the Search index definition.
    PathScope:
      name: SCOPE_NAME
      in: path
      required: true
      schema:
        type: string
      description: The name of the scope containing the Search index definition.
    PathIndex:
      name: INDEX_NAME
      in: path
      required: true
      schema:
        type: string
        pattern: ^[A-Za-z][0-9A-Za-z_\-]*$
      description: The name of the Search index definition.
    PathIndexFull:
      name: INDEX_NAME
      in: path
      required: true
      schema:
        type: string
      description: |-
        The name of the Search index definition.
        You must use the fully qualified name for the index, which includes the bucket and scope.

        To view the full, scoped name for an index for use with this endpoint:

        1. Go to the **Search** tab in the Couchbase Server Web Console.
        2. Point to the **Index Name** for an index.
    PathOpIngest:
      name: OP
      in: path
      required: true
      schema:
        type: string
        enum:
          - pause
          - resume
      description: |-
        To pause ingestion and maintenance, set `{OP}` to `pause`.
        To resume ingestion and maintenance on a paused index, set `{OP}` to `resume`.
    PathOpPartition:
      name: OP
      in: path
      required: true
      schema:
        type: string
        enum:
          - freeze
          - unfreeze
      description: |-
        To freeze partition assignment, set `{OP}` to `freeze`.
        To unfreeze partition assignment on a frozen index, set `{OP}` to `unfreeze`.
    PathOpQuery:
      name: OP
      in: path
      required: true
      schema:
        type: string
        enum:
          - allow
          - disallow
      description: |-
        To allow queries against a Search index, set `{OP}` to `allow`.
        To block queries against a Search index, set `{OP}` to `disallow`.
  responses:
    OK:
      description: The Search Service returns a response that includes the status `ok`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MgmtResponse'
          example:
            status: ok
  schemas:
    DeleteIndexResponse:
      type: object
      title: Delete Response
      properties:
        status:
          $ref: '#/components/schemas/CommonStatus'
        uuid:
          $ref: '#/components/schemas/CommonIndexUUID'
    GetIndexesResponse:
      type: object
      title: Indexes Response
      properties:
        indexDefs:
          $ref: '#/components/schemas/GetIndexesResponseIndexes'
        status:
          $ref: '#/components/schemas/CommonStatus'
    GetIndexesResponseIndexes:
      title: Index Definitions
      type: object
      description: An object containing Search index definitions and related information.
      properties:
        implVersion:
          type: string
        indexDefs:
          $ref: '#/components/schemas/GetIndexesResponseIndexesWrapper'
        uuid:
          type: string
    GetIndexesResponseIndexesWrapper:
      title: Index Definitions Wrapper
      type: object
      description: An object containing 1 or more Search index definitions.
      additionalProperties:
        x-additionalPropertiesName: Index Name
        $ref: '#/components/schemas/IndexDefinition'
    GetIndexResponse:
      type: object
      title: Index Response
      properties:
        indexDef:
          $ref: '#/components/schemas/IndexDefinition'
        planPIndexes:
          type: array
          description: An array of objects, each containing information about a single Search index partition.
          items:
            $ref: '#/components/schemas/GetIndexResponsePIndex'
        status:
          $ref: '#/components/schemas/CommonStatus'
        warnings:
          type: array
          description: An array of warnings.
          items:
            type: string
    GetIndexResponsePIndex:
      type: object
      title: Plan Partition
      description: An object containing information about a single Search index partition.
      properties:
        indexName:
          $ref: '#/components/schemas/CommonIndexName'
        indexParams:
          $ref: '#/components/schemas/CommonIndexParams'
        indexType:
          $ref: '#/components/schemas/CommonIndexType'
        indexUUID:
          $ref: '#/components/schemas/CommonIndexUUID'
        name:
          $ref: '#/components/schemas/CommonPIndexName'
        nodes:
          $ref: '#/components/schemas/GetIndexResponsePIndexNodesWrapper'
        sourceName:
          $ref: '#/components/schemas/CommonSourceName'
        sourceParams:
          $ref: '#/components/schemas/CommonSourceParams'
        sourcePartitions:
          type: string
        sourceType:
          $ref: '#/components/schemas/CommonSourceType'
        sourceUUID:
          $ref: '#/components/schemas/CommonSourceUUID'
        uuid:
          $ref: '#/components/schemas/CommonPIndexUUID'
    GetIndexResponsePIndexNodesWrapper:
      type: object
      title: Partition Nodes Wrapper
      description: An object containing information about 1 or more Search index partition nodes.
      additionalProperties:
        x-additionalPropertiesName: Node UUID
        $ref: '#/components/schemas/GetIndexResponsePIndexNodesWrapperNode'
    GetIndexResponsePIndexNodesWrapperNode:
      type: object
      title: Partition Node
      description: |-
        An object containing information about a single Search index partition node.
        The name of the property is the node UUID.
      properties:
        canRead:
          type: boolean
        canWrite:
          type: boolean
        priority:
          type: integer
    StatsNodeResponse:
      type: object
      title: Node Statistics
      properties:
        feeds:
          type: object
        manager:
          $ref: '#/components/schemas/StatsNodeResponseMgr'
        pindexes:
          type: object
    StatsNodeResponseMgr:
      type: object
      title: Manager Statistics
      properties:
        TotCreateIndex:
          type: integer
        TotDeleteIndex:
          type: integer
        TotUpdateIndex:
          type: integer
        TotBatchIntro:
          type: integer
        TotBatchIntroFail:
          type: integer
        TotBatchUpdate:
          type: integer
        TotBatchUpdateFail:
          type: integer
        TotBatchDelete:
          type: integer
        TotBatchDeleteFail:
          type: integer
        TotBatchGet:
          type: integer
        TotBleveDestStart:
          type: integer
        TotBleveDestStop:
          type: integer
        TotBleveDestRemove:
          type: integer
        TotBleveDestUpdate:
          type: integer
        TotBleveDestUpdateFail:
          type: integer
        TotBleveDestIntro:
          type: integer
        TotBleveDestIntroFail:
          type: integer
        TotBleveDestBatch:
          type: integer
        TotBleveDestBatchFail:
          type: integer
        TotBleveDestDelete:
          type: integer
        TotBleveDestDeleteFail:
          type: integer
        TotBleveDestClose:
          type: integer
        TotBleveDestCloseFail:
          type: integer
        TotQuery:
          type: integer
        TotQueryFail:
          type: integer
    StatsIndexResponse:
      type: object
      title: Index Statistics
      properties:
        feeds:
          type: object
        pindexes:
          type: object
    LookupRequest:
      type: object
      title: Lookup Request
      properties:
        docID:
          type: string
          description: The document ID to look up in the Search index.
    LookupResponse:
      type: object
      title: Lookup Response
      properties:
        status:
          $ref: '#/components/schemas/CommonStatus'
        pindexes:
          $ref: '#/components/schemas/LookupResponsePartitions'
    LookupResponsePartitions:
      type: object
      title: Lookup Partition Wrapper
      description: An object containing information about 1 or more Search index partitions.
      additionalProperties:
        x-additionalPropertiesName: Partition Name
        $ref: '#/components/schemas/LookupResponsePartitionsID'
    LookupResponsePartitionsID:
      type: object
      title: Lookup Partition
      description: |-
        An object containing information about a single Search index partition.
        The name of the property is the Search index partition name.
      properties:
        id:
          type: string
          description: The Search index partition ID.
    PutIndexResponse:
      type: object
      title: Create or Update Response
      properties:
        status:
          $ref: '#/components/schemas/CommonStatus'
        name:
          $ref: '#/components/schemas/CommonIndexName'
        uuid:
          $ref: '#/components/schemas/CommonIndexUUID'
    DocumentAnalysis:
      type: object
      title: Document Analysis
      properties:
        status:
          $ref: '#/components/schemas/CommonStatus'
        analyzed:
          type: array
          description: An array of objects containing the analysis of the document.
          items:
            $ref: '#/components/schemas/DocumentAnalysisItem'
    DocumentAnalysisItem:
      type: object
      title: Analysis Item
      description: An object containing 1 or more search terms or tokens from the analyzed document.
      additionalProperties:
        x-additionalPropertiesName: Search Token
        $ref: '#/components/schemas/DocumentAnalysisItemToken'
    DocumentAnalysisItemToken:
      type: object
      title: Analysis Token
      description: |-
        An object containing the analysis of a single search term or token from the analyzed document.
        The name of the property is the search term or token.
      properties:
        Term:
          type: string
        Locations:
          type: array
          description: An array of objects describing the locations of the search term or token in the document.
          items:
            $ref: '#/components/schemas/DocumentAnalysisItemTokenLocation'
    DocumentAnalysisItemTokenLocation:
      type: object
      title: Analysis Token Location
      description: An object describing the location of a single instance of the search term or token in the analyzed document.
      properties:
        Field:
          type: string
          description: The field in the document where the token was found.
        ArrayPositions:
          type: array
          items: {}
        Start:
          type: integer
          description: The starting point of the token in the field.
        End:
          type: integer
          description: The ending point of the token in the field.
        Position:
          type: integer
          description: The position of the token in the field.
    DocumentCount:
      type: object
      title: Document Count
      properties:
        status:
          $ref: '#/components/schemas/CommonStatus'
        count:
          type: integer
          description: The document count for the specified index.
    IndexDefinition:
      type: object
      title: Index Definition
      description: |-
        The full Search index definition.
        For a detailed list of all parameters, see [Search Index JSON Properties](../search/search-index-params.html).
      properties:
        name:
          $ref: '#/components/schemas/CommonIndexName'
        type:
          $ref: '#/components/schemas/CommonIndexType'
        sourceName:
          $ref: '#/components/schemas/CommonSourceName'
        sourceUUID:
          $ref: '#/components/schemas/CommonSourceUUID'
        sourceParams:
          $ref: '#/components/schemas/CommonSourceParams'
        sourceType:
          $ref: '#/components/schemas/CommonSourceType'
        params:
          $ref: '#/components/schemas/CommonIndexParams'
        planParams:
          $ref: '#/components/schemas/IndexDefinitionPlanParams'
        prevIndexUUID:
          type: string
          writeOnly: true
          description: |-
            The UUID of the previous index.
            Intended for clients that want to check that they are not overwriting the Search index definition updates of concurrent clients.
        uuid:
          $ref: '#/components/schemas/CommonIndexUUID'
      required:
        - name
        - type
        - sourceName
        - sourceType
        - params
        - planParams
    IndexDefinitionPlanParams:
      title: Plan Parameters
      type: object
      description: |-
        The Search index's partitioning and replication settings.
        For more information, see [Plan Params Object](../search/search-index-params.html#planParams).
      properties:
        hierarchyRules:
          type: string
          nullable: true
        maxPartitionsPerPIndex:
          type: integer
          description: |-
            This setting is deprecated.
            Use `indexPartitions` instead.
        indexPartitions:
          type: integer
          description: The number of partitions to split the Search index into, across the nodes you have available in your database with the Search Service enabled.
        nodePlanParams:
          type: string
          nullable: true
        numReplicas:
          type: integer
          description: The number of replicas the Search Service creates for the Search index to ensure high availability.
        planFrozen:
          type: boolean
    QueryRequest:
      type: object
      title: Query Request
      properties:
        query:
          type: object
          description: |-
            An object that contains the properties for one of the supported query types.
            For more information, see [Query Object](../search/search-request-params.html#query-object).
        knn:
          type: array
          description: |-
            An array that contains objects that describe a Vector Search query.
            For more information, see [Knn Objects](../search/search-request-params.html#knn-object).
          items:
            type: object
        ctl:
          type: object
          description: |-
            An object that contains properties for query consistency.
            For more information, see [Ctl Object](../search/search-request-params.html#ctl).
        size:
          type: integer
          description: Set the total number of results to return for a single page of search results.
        from:
          type: integer
          description: Set an offset value to change where pagination starts for search results.
        highlight:
          type: object
          description: |-
            Contains properties to control search result highlighting.
            For more information, see [Highlight Objects](../search/search-request-params.html#highlight).
        fields:
          type: array
          description: An array of strings to specify each indexed field you want to return in search results.
          items:
            type: string
        facets:
          type: object
          description: |-
            Contains nested objects to define each facet you want to return with search results.
            For more information, see [Facet Objects](../search/search-request-params.html#facet-name).
        explain:
          type: boolean
          description: Whether to create an explanation for a search result's score in search results.
        sort:
          type: array
          description: |-
            Contains an array of strings or JSON objects to set how to sort search results.
            For more information, see [Sort Object](../search/search-request-params.html#sort).
          items: {}
        includeLocations:
          type: boolean
          description: Whether to return the position of each occurrence of a search term inside a document.
        score:
          type: string
          description: Whether to include document relevancy scoring in search results.
        search_after:
          type: array
          description: Use to control pagination in search results.
          items:
            type: string
        search_before:
          type: array
          description: Use to control pagination in search results.
          items:
            type: string
        collections:
          type: array
          description: An array of strings that specify the collections where you want to run the query.
          items:
            type: string
    QueryResponse:
      type: object
      title: Query Response
      properties:
        status:
          $ref: '#/components/schemas/CommonStatus'
        results:
          type: array
          description: The results of the Search query.
          items:
            type: object
    MgmtResponse:
      type: object
      title: Management Response
      properties:
        status:
          $ref: '#/components/schemas/CommonStatus'
    StatusResponse:
      type: object
      title: Status Response
      properties:
        status:
          $ref: '#/components/schemas/CommonStatus'
        indexStatus:
          type: string
          description: The status of the Search index.
    CommonStatus:
      type: string
      title: Status
      description: The status of the operation.
    CommonIndexName:
      type: string
      title: Index Name
      description: |-
        The name of the Search index.
        For more information, see [Initial Settings](../search/search-index-params.html#initial).
    CommonIndexParams:
      type: object
      title: Index Parameters
      description: |-
        The Search index's type identifier, type mappings, and analyzers.
        For more information, see [Params Object](../search/search-index-params.html#params).
    CommonIndexType:
      type: string
      title: Index Type
      description: |-
        The type of the Search index.
        For more information, see [Initial Settings](../search/search-index-params.html#initial).
    CommonIndexUUID:
      type: string
      title: Index UUID
      description: |-
        The UUID of the Search index.
        For more information, see [Initial Settings](../search/search-index-params.html#initial).
    CommonSourceName:
      type: string
      title: Source Name
      description: |-
        The name of the bucket where the Search index is stored.
        For more information, see [Initial Settings](../search/search-index-params.html#initial).
    CommonSourceParams:
      type: object
      title: Source Parameters
      description: |-
        Advanced settings for Search index behavior.
        For more information, see [Initial Settings](../search/search-index-params.html#initial).
    CommonSourceType:
      type: string
      title: Source Type
      description: |-
        The type of the bucket where the Search index is stored.
        For more information, see [Initial Settings](../search/search-index-params.html#initial).
    CommonSourceUUID:
      type: string
      title: Source UUID
      description: |-
        The UUID of the bucket where the Search index is stored.
        For more information, see [Initial Settings](../search/search-index-params.html#initial).
    CommonPIndexName:
      type: string
      title: Partition Name
      description: The name of the Search index partition.
    CommonPIndexUUID:
      type: string
      title: Partition UUID
      description: The UUID of the Search index partition.
  securitySchemes:
    Manage:
      type: http
      scheme: basic
      description: You must have the **Search Admin** role, with `cluster.bucket[$BUCKET_NAME].fts!manage` permissions on the required bucket.
    Statistics:
      type: http
      scheme: basic
      description: You must have the **Search Admin** role, with `cluster.bucket[$BUCKET_NAME].stats!read` permissions on the required bucket.
    Read:
      type: http
      scheme: basic
      description: You must have the **Search Reader** or **Search Admin** role, with `cluster.bucket[$BUCKET_NAME].fts!read` permissions on the required bucket.
    Write:
      type: http
      scheme: basic
      description: You must have the **Search Admin** role, with `cluster.bucket[$BUCKET_NAME].fts!write` permissions on the required bucket.
