Skip to content

Commit bf852d9

Browse files
authored
[DOCS] Use query parameters in search API example (#73158) (#73174)
The current search API documentation doesn't include any examples of query parameter usage. This updates the docs to include a simple syntax example using the `from` and `size` query parameters.
1 parent eb64fb4 commit bf852d9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docs/reference/search/search.asciidoc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ Key is the field name. Value is the value for the field.
766766

767767
[source,console]
768768
----
769-
GET /my-index-000001/_search
769+
GET /my-index-000001/_search?from=40&size=20
770770
{
771771
"query": {
772772
"term": {
@@ -776,6 +776,7 @@ GET /my-index-000001/_search
776776
}
777777
----
778778
// TEST[setup:my_index]
779+
// TEST[s/\?from=40&size=20//]
779780

780781
The API returns the following response:
781782

@@ -792,7 +793,7 @@ The API returns the following response:
792793
},
793794
"hits": {
794795
"total": {
795-
"value": 1,
796+
"value": 20,
796797
"relation": "eq"
797798
},
798799
"max_score": 1.3862942,
@@ -822,9 +823,12 @@ The API returns the following response:
822823
"id": "kimchy"
823824
}
824825
}
825-
}
826+
},
827+
...
826828
]
827829
}
828830
}
829831
----
830832
// TESTRESPONSE[s/"took": 5/"took": $body.took/]
833+
// TESTRESPONSE[s/"value": 20,/"value": 1,/]
834+
// TESTRESPONSE[s/,\n \.\.\.//]

0 commit comments

Comments
 (0)