Skip to content

Indices

Index naming uses news_docs_v{n} with alias news_docs. Templates live in api/resources/search/templates.


Indices, Aliases & ILM (v0.4)

Naming

  • Versioned index: <domain>-v{n} (e.g., news-v3)
  • Aliases: <domain>-read and <domain>-write

Mappings (excerpt)

{
  "mappings": {
    "properties": {
      "title": {"type": "text", "analyzer": "ar_standard_en"},
      "content": {"type": "text", "analyzer": "ar_standard_en"},
      "published_at": {"type": "date"},
      "lang": {"type": "keyword"},
      "vector": {"type": "knn_vector", "dimension": 768}
    }
  }
}

Analyzers (Arabic/English)

{
  "analysis": {
    "analyzer": {
      "ar_standard_en": {
        "type": "custom",
        "char_filter": ["html_strip"],
        "tokenizer": "standard",
        "filter": ["lowercase", "arabic_normalization", "arabic_stem", "stop", "icu_folding"]
      }
    }
  }
}

ILM/ISM

  • Hot tier: 0–7d, refresh 1s
  • Warm tier: 7–30d, force-merge weekly
  • Delete after 180d (configurable)

Snapshots

  • Daily to S3-compatible repo; test restores weekly

Cutover (aliases)

POST _aliases
{
  "actions":[
    {"remove":{"index":"news-v2","alias":"news-read"}},
    {"add":{"index":"news-v3","alias":"news-read"}},
    {"remove":{"index":"news-v2","alias":"news-write"}},
    {"add":{"index":"news-v3","alias":"news-write"}}
  ]
}