Lowercase token filter

The lowercase token filter is used to convert all characters in the token stream to lowercase, making searches case insensitive.

Parameters

The lowercase token filter can be configured with the following parameter.

ParameterRequired/OptionalDescription
languageOptionalSpecifies a language-specific token filter. Valid values are:
- greek
- irish
- turkish.
Default is the Lucene LowerCaseFilter.

Example

The following example request creates a new index named custom_lowercase_example. It configures an analyzer with a lowercase filter and specifies greek as the language:

  1. PUT /custom_lowercase_example
  2. {
  3. "settings": {
  4. "analysis": {
  5. "analyzer": {
  6. "greek_lowercase_example": {
  7. "type": "custom",
  8. "tokenizer": "standard",
  9. "filter": ["greek_lowercase"]
  10. }
  11. },
  12. "filter": {
  13. "greek_lowercase": {
  14. "type": "lowercase",
  15. "language": "greek"
  16. }
  17. }
  18. }
  19. }
  20. }

copy

Generated tokens

Use the following request to examine the tokens generated using the analyzer:

  1. GET /custom_lowercase_example/_analyze
  2. {
  3. "analyzer": "greek_lowercase_example",
  4. "text": "Αθήνα ΕΛΛΑΔΑ"
  5. }

copy

The response contains the generated tokens:

  1. {
  2. "tokens": [
  3. {
  4. "token": "αθηνα",
  5. "start_offset": 0,
  6. "end_offset": 5,
  7. "type": "<ALPHANUM>",
  8. "position": 0
  9. },
  10. {
  11. "token": "ελλαδα",
  12. "start_offset": 6,
  13. "end_offset": 12,
  14. "type": "<ALPHANUM>",
  15. "position": 1
  16. }
  17. ]
  18. }