Skip to content

Commit

Permalink
adding more examples
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Rubin <[email protected]>
  • Loading branch information
AntonEliatra committed Oct 14, 2024
1 parent a3daaa0 commit 336f848
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions _analyzers/standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,28 @@ PUT /my_custom_index
```
{% include copy-curl.html %}

## Generated tokens

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

```json
POST /my_custom_index/_analyze
{
"analyzer": "my_custom_analyzer",
"text": "The slow turtle swims away"
}
```
{% include copy-curl.html %}

The response contains the generated tokens:

```json
{
"tokens": [
{"token": "slow","start_offset": 4,"end_offset": 8,"type": "<ALPHANUM>","position": 1},
{"token": "turtle","start_offset": 9,"end_offset": 15,"type": "<ALPHANUM>","position": 2},
{"token": "swims","start_offset": 16,"end_offset": 21,"type": "<ALPHANUM>","position": 3},
{"token": "away","start_offset": 22,"end_offset": 26,"type": "<ALPHANUM>","position": 4}
]
}
```

0 comments on commit 336f848

Please sign in to comment.