elasticsearch/docs/reference/text-analysis/analysis-uaxurlemail-tokenizer.md
Colleen McGinnis 9bcd59596d
[docs] Prepare for docs-assembler (#125118)
* reorg files for docs-assembler and create toc.yml files

* fix build error, add redirects

* only toc

* move images
2025-03-20 12:09:12 -05:00

1.8 KiB

navigation_title mapped_pages
UAX URL email
https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-uaxurlemail-tokenizer.html

UAX URL email tokenizer [analysis-uaxurlemail-tokenizer]

The uax_url_email tokenizer is like the standard tokenizer except that it recognises URLs and email addresses as single tokens.

Example output [_example_output_18]

POST _analyze
{
  "tokenizer": "uax_url_email",
  "text": "Email me at john.smith@global-international.com"
}

The above sentence would produce the following terms:

[ Email, me, at, john.smith@global-international.com ]

while the standard tokenizer would produce:

[ Email, me, at, john.smith, global, international.com ]

Configuration [_configuration_21]

The uax_url_email tokenizer accepts the following parameters:

max_token_length
The maximum token length. If a token is seen that exceeds this length then it is split at max_token_length intervals. Defaults to 255.

Example configuration [_example_configuration_14]

In this example, we configure the uax_url_email tokenizer to have a max_token_length of 5 (for demonstration purposes):

PUT my-index-000001
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "tokenizer": "my_tokenizer"
        }
      },
      "tokenizer": {
        "my_tokenizer": {
          "type": "uax_url_email",
          "max_token_length": 5
        }
      }
    }
  }
}

POST my-index-000001/_analyze
{
  "analyzer": "my_analyzer",
  "text": "john.smith@global-international.com"
}

The above example produces the following terms:

[ john, smith, globa, l, inter, natio, nal.c, om ]