-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOCS] Add behavioral analytics and search application examples (#3392)
Co-authored-by: István Zoltán Szabó <szabosteve@gmail.com> (cherry picked from commit a83a6ed)
- Loading branch information
Showing
14 changed files
with
149 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
specification/search_application/get/SearchApplicationGetResponseExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# summary: search-application/apis/get-search-application.asciidoc:95 | ||
description: A sucessful response from `GET _application/search_application/my-app/`. | ||
# type: response | ||
# response_code: 200 | ||
value: | ||
"{\n \"name\": \"my-app\",\n \"indices\": [ \"index1\", \"index2\" ],\n \ | ||
\ \"updated_at_millis\": 1682105622204,\n \"template\": {\n \"script\": {\n\ | ||
\ \"source\": {\n \"query\": {\n \"query_string\": {\n \ | ||
\ \"query\": \"{{query_string}}\",\n \"default_field\": \"{{default_field}}\"\ | ||
\n }\n }\n },\n \"lang\": \"mustache\",\n \"options\"\ | ||
: {\n \"content_type\": \"application/json;charset=utf-8\"\n },\n \ | ||
\ \"params\": {\n \"query_string\": \"*\",\n \"default_field\"\ | ||
: \"*\"\n }\n }\n }\n}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...n/search_application/get_behavioral_analytics/BehavioralAnalyticsGetResponseExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# summary: behavioral-analytics/apis/list-analytics-collection.asciidoc:112 | ||
description: A successful response from `GET _application/analytics/my*` | ||
# type: response | ||
# response_code: 200 | ||
value: | ||
"{\n \"my_analytics_collection\": {\n \"event_data_stream\": {\n \ | ||
\ \"name\": \"behavioral_analytics-events-my_analytics_collection\"\n \ | ||
\ }\n },\n \"my_analytics_collection2\": {\n \"event_data_stream\": {\n \ | ||
\ \"name\": \"behavioral_analytics-events-my_analytics_collection2\"\n \ | ||
\ }\n }\n}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
specification/search_application/list/SearchApplicationsListResponseExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# summary: search-application/apis/list-search-applications.asciidoc:108 | ||
description: A succesful response from `GET _application/search_application?from=0&size=3&q=app*` returns the first three search applications whose names start with `app`. | ||
# type: response | ||
# response_code: 200 | ||
value: | ||
"{\n \"count\": 2,\n \"results\": [\n {\n \"name\": \"app-1\",\n\ | ||
\ \"updated_at_millis\": 1690981129366\n },\n {\n \"name\": \"app-2\"\ | ||
,\n \"updated_at_millis\": 1691501823939\n }\n ]\n}" |
17 changes: 17 additions & 0 deletions
17
specification/search_application/put/SearchApplicationPutRequestExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# summary: search-application/apis/put-search-application.asciidoc:148 | ||
# method_request: PUT _application/search_application/my-app | ||
description: > | ||
Run `PUT _application/search_application/my-app` to create or update a search application called `my-app`. When the dictionary parameter is specified, the search application search API will perform the following parameter validation: it accepts only the `query_string` and `default_field` parameters; it verifies that `query_string` and `default_field` are both strings; it accepts `default_field` only if it takes the values title or description. If the parameters are not valid, the search application search API will return an error. | ||
# type: request | ||
value: | ||
"{\n \"indices\": [ \"index1\", \"index2\" ],\n \"template\": {\n \"script\"\ | ||
: {\n \"source\": {\n \"query\": {\n \"query_string\": {\n\ | ||
\ \"query\": \"{{query_string}}\",\n \"default_field\": \"\ | ||
{{default_field}}\"\n }\n }\n },\n \"params\": {\n \ | ||
\ \"query_string\": \"*\",\n \"default_field\": \"*\"\n }\n },\n\ | ||
\ \"dictionary\": {\n \"properties\": {\n \"query_string\": {\n \ | ||
\ \"type\": \"string\"\n },\n \"default_field\": {\n \ | ||
\ \"type\": \"string\",\n \"enum\": [\n \"title\",\n \ | ||
\ \"description\"\n ]\n },\n \"additionalProperties\"\ | ||
: false\n },\n \"required\": [\n \"query_string\"\n ]\n \ | ||
\ }\n }\n}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
specification/search_application/search/SearchApplicationsSearchRequestExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# summary: search-application/apis/search-application-search.asciidoc:125 | ||
# method_request: POST _application/search_application/my-app/_search | ||
description: Use `POST _application/search_application/my-app/_search` to run a search against a search application called `my-app` that uses a search template. | ||
# type: request | ||
value: | ||
"{\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\"\ | ||
: [\n {\"name\": \"title\", \"boost\": 5},\n {\"name\": \"description\"\ | ||
, \"boost\": 1}\n ]\n }\n}" |