Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Reformat suggesters page #47010

Merged
merged 1 commit into from
Sep 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 25 additions & 15 deletions docs/reference/search/suggesters.asciidoc
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
[[search-suggesters]]
=== Suggesters

The suggest feature suggests similar looking terms based on a provided
text by using a suggester. Parts of the suggest feature are still under
development.

The suggest request part is defined alongside the query part in a `_search`
request. If the query part is left out, only suggestions are returned.

NOTE: `_suggest` endpoint has been deprecated in favour of using suggest via
`_search` endpoint. In 5.0, the `_search` endpoint has been optimized for
suggest only search requests.
Suggests similar looking terms based on a provided text by using a suggester.
Parts of the suggest feature are still under development.

[source,console]
--------------------------------------------------
Expand All @@ -33,10 +25,27 @@ POST twitter/_search
--------------------------------------------------
// TEST[setup:twitter]

Several suggestions can be specified per request. Each suggestion is
identified with an arbitrary name. In the example below two suggestions
are requested. Both `my-suggest-1` and `my-suggest-2` suggestions use
the `term` suggester, but have a different `text`.

[[search-suggesters-api-request]]
==== {api-request-title}

The suggest feature suggests similar looking terms based on a provided text by
using a suggester. The suggest request part is defined alongside the query part
in a `_search` request. If the query part is left out, only suggestions are
returned.

NOTE: `_suggest` endpoint has been deprecated in favour of using suggest via
`_search` endpoint. In 5.0, the `_search` endpoint has been optimized for
suggest only search requests.


[[search-suggesters-api-example]]
==== {api-examples-title}

Several suggestions can be specified per request. Each suggestion is identified
with an arbitrary name. In the example below two suggestions are requested. Both
`my-suggest-1` and `my-suggest-2` suggestions use the `term` suggester, but have
a different `text`.

[source,console]
--------------------------------------------------
Expand All @@ -60,6 +69,7 @@ POST _search
--------------------------------------------------
// TEST[setup:twitter]


The below suggest response example includes the suggestion response for
`my-suggest-1` and `my-suggest-2`. Each suggestion part contains
entries. Each entry is effectively a token from the suggest text and
Expand Down Expand Up @@ -107,7 +117,7 @@ term suggester's score is based on the edit distance.

[float]
[[global-suggest]]
==== Global suggest text
===== Global suggest text

To avoid repetition of the suggest text, it is possible to define a
global text. In the example below the suggest text is defined globally
Expand Down