123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- [role="xpack"]
- [[list-search-applications]]
- === List Search Applications
- beta::[]
- ++++
- <titleabbrev>List Search Applications</titleabbrev>
- ++++
- Returns information about Search Applications.
- [[list-search-applications-request]]
- ==== {api-request-title}
- `GET _application/search_application/`
- [[list-search-applications-prereq]]
- ==== {api-prereq-title}
- Requires the `manage_search_application` cluster privilege.
- [[list-search-applications-path-params]]
- ==== {api-path-parms-title}
- `q`::
- (Optional, string) Query in the Lucene query string syntax, to return only search applications matching the query.
- `size`::
- (Optional, integer) Maximum number of results to retrieve.
- `from`::
- (Optional, integer) The offset from the first result to fetch.
- [[list-search-applications-response-codes]]
- ==== {api-response-codes-title}
- [[list-search-applications-example]]
- ==== {api-examples-title}
- The following example lists all configured search applications:
- ////
- [source,console]
- --------------------------------------------------
- PUT index1
- PUT _application/search_application/app-1
- {
- "indices": [ "index1" ],
- "template": {
- "script": {
- "source": {
- "query": {
- "query_string": {
- "query": "{{query_string}}"
- }
- }
- }
- }
- }
- }
- PUT _application/search_application/app-2
- {
- "indices": [ "index1" ],
- "template": {
- "script": {
- "source": {
- "query": {
- "query_string": {
- "query": "{{query_string}}"
- }
- }
- }
- }
- }
- }
- --------------------------------------------------
- // TESTSETUP
- [source,console]
- --------------------------------------------------
- DELETE _application/search_application/app-1
- DELETE _application/search_application/app-2
- --------------------------------------------------
- // TEARDOWN
- ////
- [source,console]
- ----
- GET _application/search_application/
- ----
- The following example queries the first three search applications whose names start with `app`:
- [source,console]
- ----
- GET _application/search_application?from=0&size=3&q=app*
- ----
- A sample response:
- [source,console-result]
- ----
- {
- "count": 2,
- "results": [
- {
- "name": "app-1",
- "updated_at_millis": 1690981129366
- },
- {
- "name": "app-2",
- "updated_at_millis": 1691501823939
- }
- ]
- }
- ----
- // TESTRESPONSE[s/"updated_at_millis": 1690981129366/"updated_at_millis": $body.$_path/]
- // TESTRESPONSE[s/"updated_at_millis": 1691501823939/"updated_at_millis": $body.$_path/]
|