Skip to content

Commit

Permalink
[DOCS] Reformat suggesters page. (#47010)
Browse files Browse the repository at this point in the history
  • Loading branch information
szabosteve authored Sep 25, 2019
1 parent fd0946b commit 69422b9
Showing 1 changed file with 25 additions and 15 deletions.
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

0 comments on commit 69422b9

Please sign in to comment.