mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -04:00
Update Flatten Graph Docs to Include a Real Flattened Graph 9.x (#123901)
updated flatten graph docs to include a real flattened graph
This commit is contained in:
parent
66a812321b
commit
be577e382d
3 changed files with 12 additions and 8 deletions
2
docs/images/token-graph-dns-synonym-ex2.svg
Normal file
2
docs/images/token-graph-dns-synonym-ex2.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 20 KiB |
2
docs/images/token-graph-dns-synonym-flattened-ex2.svg
Normal file
2
docs/images/token-graph-dns-synonym-flattened-ex2.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 19 KiB |
|
@ -25,7 +25,7 @@ The `flatten_graph` filter uses Lucene’s [FlattenGraphFilter](https://lucene.a
|
|||
|
||||
To see how the `flatten_graph` filter works, you first need to produce a token graph containing multi-position tokens.
|
||||
|
||||
The following [analyze API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-analyze) request uses the `synonym_graph` filter to add `dns` as a multi-position synonym for `domain name system` in the text `domain name system is fragile`:
|
||||
The following [analyze API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-analyze) request uses the `synonym_graph` filter to add `internet phonebook` as a multi-position synonym for `domain name system` in the text `domain name system is fragile`:
|
||||
|
||||
```console
|
||||
GET /_analyze
|
||||
|
@ -34,17 +34,17 @@ GET /_analyze
|
|||
"filter": [
|
||||
{
|
||||
"type": "synonym_graph",
|
||||
"synonyms": [ "dns, domain name system" ]
|
||||
"synonyms": [ "internet phonebook, domain name system" ]
|
||||
}
|
||||
],
|
||||
"text": "domain name system is fragile"
|
||||
}
|
||||
```
|
||||
|
||||
The filter produces the following token graph with `dns` as a multi-position token.
|
||||
The filter produces the following token graph with `internet phonebook` as a multi-position token.
|
||||
|
||||
:::{image} ../../../images/token-graph-dns-synonym-ex.svg
|
||||
:alt: token graph dns synonym ex
|
||||
:::{image} ../../../images/token-graph-dns-synonym-ex2.svg
|
||||
:alt: token graph dns synonym example
|
||||
:::
|
||||
|
||||
Indexing does not support token graphs containing multi-position tokens. To make this token graph suitable for indexing, it needs to be flattened.
|
||||
|
@ -58,7 +58,7 @@ GET /_analyze
|
|||
"filter": [
|
||||
{
|
||||
"type": "synonym_graph",
|
||||
"synonyms": [ "dns, domain name system" ]
|
||||
"synonyms": [ "internet phonebook, domain name system" ]
|
||||
},
|
||||
"flatten_graph"
|
||||
],
|
||||
|
@ -68,8 +68,8 @@ GET /_analyze
|
|||
|
||||
The filter produces the following flattened token graph, which is suitable for indexing.
|
||||
|
||||
:::{image} ../../../images/token-graph-dns-invalid-ex.svg
|
||||
:alt: token graph dns invalid ex
|
||||
:::{image} ../../../images/token-graph-dns-synonym-flattened-ex2.svg
|
||||
:alt: token graph dns flattened example
|
||||
:::
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue