Decimal digit token filter

Converts all digits in the Unicode Decimal_Number General Category to 0-9. For example, the filter changes the Bengali numeral to 3.

This filter uses Lucene’s DecimalDigitFilter.

Example

The following analyze API request uses the decimal_digit filter to convert Devanagari numerals to 0-9:

  1. GET /_analyze
  2. {
  3. "tokenizer" : "whitespace",
  4. "filter" : ["decimal_digit"],
  5. "text" : "१-one two-२ ३"
  6. }

The filter produces the following tokens:

  1. [ 1-one, two-2, 3]

Add to an analyzer

The following create index API request uses the decimal_digit filter to configure a new custom analyzer.

  1. PUT /decimal_digit_example
  2. {
  3. "settings": {
  4. "analysis": {
  5. "analyzer": {
  6. "whitespace_decimal_digit": {
  7. "tokenizer": "whitespace",
  8. "filter": [ "decimal_digit" ]
  9. }
  10. }
  11. }
  12. }
  13. }