Skip to content

Latest commit

 

History

History
62 lines (49 loc) · 1.19 KB

README.md

File metadata and controls

62 lines (49 loc) · 1.19 KB

Thai Analysis Plugin for OpenSearch

The Thaichub2 (thai-chub-chub) Analysis Plugin integrates the Thai word segmentation modules into OpenSearch. Forked from : https://github.com/tlefsad/elasticsearch-analysis-thaichub2

Installation on OpenSearch

  • Download a release zip from the release page matching your OpenSearch version.

  • Install with this command

./bin/opensearch-plugin install --batch file:///<path to zip>
  • Restart OpenSearch

Sample Usage

Sample request

POST _analyze
{
    "analyzer": "thaichub2_analyzer",
    "text": "นมตรามะลิ"
}

Result

{
  "tokens" : [
    {
      "token" : "นม",
      "start_offset" : 0,
      "end_offset" : 2,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "ตรา",
      "start_offset" : 2,
      "end_offset" : 5,
      "type" : "word",
      "position" : 1
    },
    {
      "token" : "มะลิ",
      "start_offset" : 5,
      "end_offset" : 9,
      "type" : "word",
      "position" : 2
    }
  ]
}

Thanks