Working with full-text indexes

Create a full-text index

post /_api/index#fulltext
The fulltext index type is deprecated from version 3.10 onwards.

Creates a fulltext index for the collection collection-name, if it does not already exist. The call expects an object containing the index details.

Path Parameters
    Query Parameters
    • The collection name.

    HTTP Headers
      Request Body application/json
      • an array of attribute names. Currently, the array is limited to exactly one attribute.

      • You can set this option to true to create the index in the background, which will not write-lock the underlying collection for as long as if the index is built in the foreground. The default value is false.

      • Minimum character length of words to index. Will default to a server-defined value if unspecified. It is thus recommended to set this value explicitly when creating the index.

      • An easy-to-remember name for the index to look it up or refer to it in index hints. Index names are subject to the same character restrictions as collection names. If omitted, a name is auto-generated so that it is unique with respect to the collection, e.g. idx_832910498.

      • must be equal to "fulltext".

      Responses
      • If the index already exists, then a HTTP 200 is returned.

      • If the index does not already exist and could be created, then a HTTP 201 is returned.

      • If the collection-name is unknown, then a HTTP 404 is returned.

      Examples

      Creating a fulltext index

      curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/index?collection=products
      {
        "type": "fulltext",
        "fields": [
          "text"
        ]
      }
      Show output