https://github.com/msarhan/elasticsearch-analysis-arabic-plugin
https://github.com/msarhan/elasticsearch-analysis-arabic-plugin
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/msarhan/elasticsearch-analysis-arabic-plugin
- Owner: msarhan
- License: apache-2.0
- Created: 2022-10-18T15:09:14.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-15T21:54:17.000Z (about 2 years ago)
- Last Synced: 2025-03-31T08:12:16.225Z (over 1 year ago)
- Language: Java
- Size: 15.6 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Arabic Analysis Plugin for Elasticsearch
Arabic Analysis plugin for Elasticsearch. It uses [lucene-arabic-analyzer](https://github.com/msarhan/lucene-arabic-analyzer) to extract arabic token roots.
## Features
- Normalizes input text by removing diacritics and Hamza-like characters
- Extracts word's roots.
## Components
- `arabic-root` analyzer
## Example
```
GET _analyze
{
"analyzer": "arabic-root",
"text": "اهْدِنَا الصِّرَاطَ الْمُسْتَقِيمَ"
}
// Result:
['هدن','هدي','صرط','قوم']
```
## Configuration
This plugin is preconfigured with builtin normalization, stop-words and a stemmer which is derived from [lucene-arabic-analyzer](https://github.com/msarhan/lucene-arabic-analyzer).
## Plugin in action
1. Build the plugin:
````
mvn clean package
````
2. Run Elasticsearch and install plugin inside a docker container:
````
docker compose up
````
3. Open `http://localhost:5601/` and login with `elastic/elastic` credentials.
4. Go to `Dev Tools` and examine the plugin:
````
GET _analyze
{
"text": "اهْدِنَا الصِّرَاطَ الْمُسْتَقِيمَ",
"analyzer": "arabic-root"
}
````