7.17.2. Prefix RK search — Groonga v14.0.9 documentation

Skip to main content
`Ctrl`+`K`

# 7.17.2. Prefix RK search

## 7.17.2.1. Summary

Groonga supports prefix RK search. RK means Romaji and Kana (reading). Prefix RK search can find registered text in katakana by query in romaji, hiragana or katakana. Found registered texts are started with query.

Prefix RK search is useful for completing Japanese text. Because romaji is widely used to input Japanese on computer. See also Japanese input methods on Wikipedia.

If users can search Japanese text in romaji, users doesn’t need to convert romaji to hiragana, katakana or kanji by themselves. For example, if you register a reading for “日本” as “ニホン”, users can find “日本” by “ni”, “に” or “二”.

The feature is helpful because it reduces one or more operations of users.

This feature is used in Completion.

You can use this feature in filter by prefix_rk_search.

## 7.17.2.2. Usage

You need TABLE_PAT_KEY table for using prefix RK search.

You need to put reading in katakana to `TABLE_PAT_KEY` as key:

Execution example:

    table_create Readings TABLE_PAT_KEY ShortText --normalizer NormalizerAuto
    # [[0,1337566253.89858,0.000355720520019531],true]
    load --table Readings
    [
    {"_key": "ニホン"},
    {"_key": "ニッポン"},
    {"_key": "ローマジ"}
    ]
    # [[0,1337566253.89858,0.000355720520019531],3]

You can finds `ニホン` and `ニッポン` by prefix RK search with `ni` as query from the `Readings` table.

You can finds `ローマジ` by prefix RK search with `r` as query from the `Readings` table.

## 7.17.2.3. How to convert romaji to reading

Prefix RK search is based on JIS X 4063:2000 specification.

The specification was obsoleted. See ローマ字入力 on Japanese Wikipedia for JIS X 4063:2000.

Normally, you can get converted results as expected.

## 7.17.2.4. See also

> - Completion

> - prefix_rk_search