Skip to content

Commit

Permalink
[DOCS] Reformat suggesters page. (elastic#47010)
Browse files Browse the repository at this point in the history
  • Loading branch information
szabosteve committed Sep 25, 2019
1 parent c99b421 commit e84fafb
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,js]
--------------------------------------------------
Expand All @@ -34,10 +26,27 @@ POST twitter/_search
// CONSOLE
// 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,js]
--------------------------------------------------
Expand All @@ -62,6 +71,7 @@ POST _search
// CONSOLE
// 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 @@ -109,7 +119,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 e84fafb

Please sign in to comment.