Add CONSOLE to several trivial search request docs.
Relates to #18160 Touches explain, fielddata-fields, fields, index-boost, min-score, named-queries-and-filters, query
This commit is contained in:
parent
6dacac49b3
commit
f22f3c7df5
|
@ -5,6 +5,7 @@ Enables explanation for each hit on how its score was computed.
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
GET /_search
|
||||
{
|
||||
"explain": true,
|
||||
"query" : {
|
||||
|
@ -12,3 +13,4 @@ Enables explanation for each hit on how its score was computed.
|
|||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
|
|
@ -6,13 +6,15 @@ example:
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
GET /_search
|
||||
{
|
||||
"query" : {
|
||||
...
|
||||
"match_all": {}
|
||||
},
|
||||
"fielddata_fields" : ["test1", "test2"]
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
Field data fields can work on fields that are not stored.
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ by a search hit.
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
GET /_search
|
||||
{
|
||||
"fields" : ["user", "postDate"],
|
||||
"query" : {
|
||||
|
@ -18,6 +19,7 @@ by a search hit.
|
|||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
`*` can be used to load all stored fields from the document.
|
||||
|
||||
|
@ -26,6 +28,7 @@ returned, for example:
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
GET /_search
|
||||
{
|
||||
"fields" : [],
|
||||
"query" : {
|
||||
|
@ -33,6 +36,7 @@ returned, for example:
|
|||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
|
||||
For backwards compatibility, if the fields parameter specifies fields which are not stored (`store` mapping set to
|
||||
|
|
|
@ -8,6 +8,7 @@ graph where each user has an index).
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
GET /_search
|
||||
{
|
||||
"indices_boost" : {
|
||||
"index1" : 1.4,
|
||||
|
@ -15,3 +16,4 @@ graph where each user has an index).
|
|||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
|
|
@ -6,6 +6,7 @@ in `min_score`:
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
GET /_search
|
||||
{
|
||||
"min_score": 0.5,
|
||||
"query" : {
|
||||
|
@ -13,6 +14,7 @@ in `min_score`:
|
|||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
Note, most times, this does not make much sense, but is provided for
|
||||
advanced use cases.
|
||||
|
|
|
@ -5,21 +5,25 @@ Each filter and query can accept a `_name` in its top level definition.
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
GET /_search
|
||||
{
|
||||
"bool" : {
|
||||
"should" : [
|
||||
"query": {
|
||||
"bool" : {
|
||||
"should" : [
|
||||
{"match" : { "name.first" : {"query" : "shay", "_name" : "first"} }},
|
||||
{"match" : { "name.last" : {"query" : "banon", "_name" : "last"} }}
|
||||
],
|
||||
"filter" : {
|
||||
"terms" : {
|
||||
"name.last" : ["banon", "kimchy"],
|
||||
"_name" : "test"
|
||||
],
|
||||
"filter" : {
|
||||
"terms" : {
|
||||
"name.last" : ["banon", "kimchy"],
|
||||
"_name" : "test"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
The search response will include for each hit the `matched_queries` it matched on. The tagging of queries and filters
|
||||
only make sense for the `bool` query.
|
||||
|
|
|
@ -6,9 +6,11 @@ query using the <<query-dsl,Query DSL>>.
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
GET /_search
|
||||
{
|
||||
"query" : {
|
||||
"term" : { "user" : "kimchy" }
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
|
Loading…
Reference in New Issue