# Arabic

The `arabic` analyzer folds the spelling variants Arabic text mixes freely, removes common
stop words and strips prefixes and suffixes (Lucene's light10 stemmer), so the definite article
and plural endings do not stop a match: a search for `كتاب` finds `الكتاب` and `كتابات`.

```json
{"fields": {"title_ar": {"type": "text", "analyzer": "arabic"}}}
```

The chain is `unicode_word`, `nfkc_cf`, `arabic_normalize`, the Lucene Arabic stop words and
`arabic_stem`, the same as Elasticsearch's `arabic` analyzer, so an index migrated from
Elasticsearch matches the same words. The stop words are normalized the same way as the text,
so a stop word written with any alef variant is removed.

## Filters

The analyzer's two filters can be used in your own chain:

| Filter | Does |
|---|---|
| `arabic_normalize` | Alef variants to bare alef, alef maksura to yeh, teh marbuta to heh; removes tatweel and harakat (vowel marks). |
| `arabic_stem` | Removes common prefixes (`ال`, `وال`, `بال`, ...) and suffixes, keeping a minimum stem length. |

For example, to keep stop words (so phrases such as titles match in full) but still normalize and
stem:

```json
{
  "type": "text",
  "analyzer": {"tokenizer": "unicode_word", "filters": ["nfkc_cf", "arabic_normalize", "arabic_stem"]}
}
```

Prefix, wildcard and fuzzy terms are normalized with `arabic_normalize` but not stemmed.

## Through the compatible APIs

The Elasticsearch and OpenSearch analyzer `arabic`, the filters `arabic_normalization` and
`stemmer` with `language: arabic`, and Solr's `text_ar` type and Arabic normalization and stem
factories all map to these components. See
[Through the compatible APIs](text-analysis.md#through-the-compatible-apis).
