Make it clear _suggest doesn't support source filtering (#21268)
We plan to deprecate `_suggest` during 5.0 so it isn't worth fixing it to support the `_source` parameter for `_source` filtering. But we should fix the docs so they are accurate. Since this removes the last non-`// CONSOLE` line in `completion-suggest.asciidoc` this also removes it from the list of files that have non-`// CONSOLE` docs. Closes #20482
This commit is contained in:
parent
9d56c1b766
commit
593d47efe2
|
@ -156,7 +156,6 @@ buildRestTests.expectedUnconvertedCandidates = [
|
|||
'reference/search/request/inner-hits.asciidoc',
|
||||
'reference/search/request/rescore.asciidoc',
|
||||
'reference/search/search-template.asciidoc',
|
||||
'reference/search/suggesters/completion-suggest.asciidoc',
|
||||
]
|
||||
|
||||
integTest {
|
||||
|
|
|
@ -202,24 +202,66 @@ The configured weight for a suggestion is returned as `_score`. The
|
|||
`text` field uses the `input` of your indexed suggestion. Suggestions
|
||||
return the full document `_source` by default. The size of the `_source`
|
||||
can impact performance due to disk fetch and network transport overhead.
|
||||
For best performance, filter out unnecessary fields from the `_source`
|
||||
To save some network overhead, filter out unnecessary fields from the `_source`
|
||||
using <<search-request-source-filtering, source filtering>> to minimize
|
||||
`_source` size. The following demonstrates an example completion query
|
||||
with source filtering:
|
||||
`_source` size. Note that the _suggest endpoint doesn't support source
|
||||
filtering but using suggest on the `_search` endpoint does:
|
||||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
POST music/_suggest
|
||||
POST music/_search?size=0
|
||||
{
|
||||
"_source": "completion.*",
|
||||
"song-suggest" : {
|
||||
"prefix" : "nir",
|
||||
"completion" : {
|
||||
"field" : "suggest"
|
||||
"_source": "suggest",
|
||||
"suggest": {
|
||||
"song-suggest" : {
|
||||
"prefix" : "nir",
|
||||
"completion" : {
|
||||
"field" : "suggest"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
// TEST[continued]
|
||||
|
||||
Which should look like:
|
||||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"took": 6,
|
||||
"timed_out": false,
|
||||
"_shards" : {
|
||||
"total" : 5,
|
||||
"successful" : 5,
|
||||
"failed" : 0
|
||||
},
|
||||
"hits": {
|
||||
"total" : 0,
|
||||
"max_score" : 0.0,
|
||||
"hits" : []
|
||||
},
|
||||
"suggest": {
|
||||
"song-suggest" : [ {
|
||||
"text" : "nir",
|
||||
"offset" : 0,
|
||||
"length" : 3,
|
||||
"options" : [ {
|
||||
"text" : "Nirvana",
|
||||
"_index": "music",
|
||||
"_type": "song",
|
||||
"_id": "1",
|
||||
"_score": 1.0,
|
||||
"_source": {
|
||||
"suggest": ["Nevermind", "Nirvana"]
|
||||
}
|
||||
} ]
|
||||
} ]
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// TESTRESPONSE[s/"took": 6,/"took": $body.took,/]
|
||||
|
||||
The basic completion suggester query supports the following parameters:
|
||||
|
||||
|
|
Loading…
Reference in New Issue