elasticsearch/docs/reference/synonyms/apis/get-synonym-rule.asciidoc
Kathleen DeRusso a2dc45bc02
[Synonyms] Mark Synonyms as GA (#103223)
* Remove beta from synonyms docs and json definitions

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2023-12-14 14:53:43 -05:00

78 lines
1.4 KiB
Text

[[get-synonym-rule]]
=== Get synonym rule
++++
<titleabbrev>Get synonym rule</titleabbrev>
++++
Retrieves a synonym rule from a synonyms set.
[[get-synonym-rule-request]]
==== {api-request-title}
`GET _synonyms/<synonyms_set>/<synonym_rule>`
[[get-synonym-rule-prereqs]]
==== {api-prereq-title}
Requires the `manage_search_synonyms` cluster privilege.
[[get-synonym-rule-path-params]]
==== {api-path-parms-title}
`<synonyms_set>`::
(Required, string)
Synonyms set identifier to retrieve the synonym rule from.
`<synonym_rule>`::
(Required, string)
Synonym rule identifier to retrieve.
[[get-synonym-rule-response-codes]]
==== {api-response-codes-title}
`404` (Missing resources)::
The `synonyms_set` identifier was not found, or the synonym rule specified by `synonym_rule` was not found in the synonyms set.
[[get-synonym-rule-example]]
==== {api-examples-title}
The following example retrieves an existing synonym rule called `test-1` for the synonyms set `my-synonyms-set`:
////
[source,console]
----
PUT _synonyms/my-synonyms-set
{
"synonyms_set": [
{
"id": "test-1",
"synonyms": "hello, hi"
},
{
"id": "test-3",
"synonyms": "bye, goodbye"
},
{
"id": "test-2",
"synonyms": "test => check"
}
]
}
----
// TESTSETUP
////
[source,console]
----
GET _synonyms/my-synonyms-set/test-1
----
[source,console-result]
----
{
"id": "test-1",
"synonyms": "hello, hi"
}
----