v6

OpenAPI 3.1.0Apache-2.0raw.githubusercontent.com2026-08-011951192.5 KB
Index

Create Index

Create an index within the directory associated with the specified API key and return the index_id.

post/api/v1/index

Headers

apikeystring required

YOUR_SECRET_API_KEY

Request body

index_namestring required

Index name, used for informational purposes only.

similarity'Bm25f' | 'Bm25fProximity'

Similarity type defines the scoring and ranking of the search results:

  • Bm25f: considers documents composed from several fields, with different field lengths and importance
  • Bm25fProximity: considers term proximity, e.g. for implicit phrase search with improved relevancy
tokenizer'AsciiAlphabetic' | 'UnicodeAlphanumeric' | 'UnicodeAlphanumericFolded' | 'Whitespace' | 'WhitespaceLowercase' | 'UnicodeAlphanumericZH'

Defines tokenizer behavior: AsciiAlphabetic

  • Mainly for for benchmark compatibility
  • Only ASCII alphabetic chars are recognized as token.

UnicodeAlphanumeric

  • All Unicode alphanumeric chars are recognized as token.
  • Allows '+' '-' '#' in middle or end of a token: c++, c#, block-max.

UnicodeAlphanumericFolded

  • All Unicode alphanumeric chars are recognized as token.
  • Allows '+' '-' '#' in middle or end of a token: c++, c#, block-max.
  • Diacritics, accents, zalgo text, umlaut, bold, italic, full-width UTF-8 characters are converted into its basic representation.
  • Apostroph handling prevents that short term parts preceding or following the apostroph get indexed (e.g. "s" in "someone's").
  • Tokenizing might be slower due to folding and apostroph processing.

UnicodeAlphanumericZH

  • Implements Chinese word segmentation to segment continuous Chinese text into tokens for indexing and search.
  • Supports mixed Latin and Chinese texts
  • Supports Chinese sentence boundary chars for KWIC snippets ahd highlighting.
  • Requires feature #[cfg(feature = "zh")]
stemmer'None' | 'Arabic' | 'Armenian' | 'Basque' | 'Catalan' | 'Czech' | 'Danish' | 'Dutch' | 'DutchPorter' | 'English' | 'Esperanto' | 'Estonian' | 'Finnish' | 'French' | 'German' | 'Greek' | 'Hindi' | 'Hungarian' | 'Indonesian' | 'Irish' | 'Italian' | 'Lithuanian' | 'Lovins' | 'Nepali' | 'Norwegian' | 'Persian' | 'Polish' | 'Porter' | 'Portuguese' | 'Romanian' | 'Russian' | 'Serbian' | 'Sesotho' | 'Spanish' | 'Swedish' | 'Tamil' | 'Turkish' | 'Ukrainian' | 'Yiddish'

Defines stemming behavior, reducing inflected words to their word stem, base or root form. Stemming increases recall, but decreases precision. It can introduce false positive results.

ngram_indexinginteger

Specify n-gram indexing for the index. N-gram indexing can improve search performance for certain types of queries. The n-gram set is defined as a bitwise combination of the following values:

  • NgramSet::SingleTerm = 0b00000000,,
  • NgramSet::NgramFF = 0b00000001, (Ngram frequent frequent)
  • NgramSet::NgramFR = 0b00000010, (Ngram frequent rare)
  • NgramSet::NgramRF = 0b00000011, (Ngram rare frequent)
  • NgramSet::NgramFFF = 0b00000100, (Ngram frequent frequent frequent)
  • NgramSet::NgramRFF = 0b00000101, (Ngram rare frequent frequent)
  • NgramSet::NgramFFR = 0b00000110, (Ngram frequent frequent rare)
  • NgramSet::NgramFRF = 0b00000111, (Ngram frequent rare frequent)

For example, to enable both NgramFF and NgramFFF, set ngram_indexing to 5 (1 | 4). Note: enabling n-gram indexing (ngram_indexing>0) will increase index size and indexing time, but improves search performance of phrase queries with frequent terms.

document_compression'None' | 'Lz4' | 'Snappy' | 'Zstd'

Compression type for document store

Example request

{
  "index_name": "demo_index",
  "schema": [
    {
      "field": "title",
      "field_type": "Text",
      "store": true,
      "index_lexical": true,
      "boost": 10
    },
    {
      "field": "body",
      "field_type": "Text",
      "store": true,
      "index_lexical": true,
      "longest": true
    },
    {
      "field": "url",
      "field_type": "Text",
      "store": true,
      "index_lexical": false
    },
    {
      "field": "date",
      "field_type": "Timestamp",
      "store": true,
      "index_lexical": false,
      "facet": true
    }
  ],
  "synonyms": [
    {
      "terms": [
        "berry",
        "lingonberry",
        "blueberry",
        "gooseberry"
      ],
      "multiway": false
    }
  ]
}

Response

Index created, returns the index_id