elasticsearch/docs/reference/elasticsearch-plugins/analysis-kuromoji-readingform.md
Colleen McGinnis b7e3a1e14b
[docs] Migrate docs from AsciiDoc to Markdown (#123507)
* delete asciidoc files

* add migrated files

* fix errors

* Disable docs tests

* Clarify release notes page titles

* Revert "Clarify release notes page titles"

This reverts commit 8be688648d.

* Comment out edternal URI images

* Clean up query languages landing pages, link to conceptual docs

* Add .md to url

* Fixes inference processor nesting.

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
Co-authored-by: Liam Thompson <leemthompo@gmail.com>
Co-authored-by: Martijn Laarman <Mpdreamz@gmail.com>
Co-authored-by: István Zoltán Szabó <szabosteve@gmail.com>
2025-02-27 17:56:14 +01:00

62 lines
1.6 KiB
Markdown

---
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-kuromoji-readingform.html
---
# kuromoji_readingform token filter [analysis-kuromoji-readingform]
The `kuromoji_readingform` token filter replaces the token with its reading form in either katakana or romaji. It accepts the following setting:
`use_romaji`
: Whether romaji reading form should be output instead of katakana. Defaults to `false`.
When using the pre-defined `kuromoji_readingform` filter, `use_romaji` is set to `true`. The default when defining a custom `kuromoji_readingform`, however, is `false`. The only reason to use the custom form is if you need the katakana reading form:
```console
PUT kuromoji_sample
{
"settings": {
"index": {
"analysis": {
"analyzer": {
"romaji_analyzer": {
"tokenizer": "kuromoji_tokenizer",
"filter": [ "romaji_readingform" ]
},
"katakana_analyzer": {
"tokenizer": "kuromoji_tokenizer",
"filter": [ "katakana_readingform" ]
}
},
"filter": {
"romaji_readingform": {
"type": "kuromoji_readingform",
"use_romaji": true
},
"katakana_readingform": {
"type": "kuromoji_readingform",
"use_romaji": false
}
}
}
}
}
}
GET kuromoji_sample/_analyze
{
"analyzer": "katakana_analyzer",
"text": "寿司" <1>
}
GET kuromoji_sample/_analyze
{
"analyzer": "romaji_analyzer",
"text": "寿司" <2>
}
```
1. Returns `スシ`.
2. Returns `sushi`.