Search
Performs a search operation in the Elasticsearch index of the current site resolved for the request and optional other indexes. See Multi-index Query for more information on performing a multiple index search.
Note
The request body must be a valid Elasticsearch JSON query as described in the official docs
Resource Information
This service uses the tomcat application on port 8080 by default. To see a list of default ports click here
The context for this API is /
.
HTTP Verb
|
POST
|
URL
|
/api/1/site/elasticsearch/search |
Response Formats
|
JSON |
Parameters
Name
|
Type
|
Required
|
Description
|
---|---|---|---|
index
|
String
|
Comma separated list of index names
to be searched in addition to the
current site
|
Example
Request
POST .../api/1/site/elasticsearch/search.json
1{
2 "_source": "localId",
3 "size": 1,
4 "query" : {
5 "match_all" : {}
6 }
7}
Response
Status 200 OK
1{
2 "took": 41,
3 "timed_out": false,
4 "_shards": {
5 "total": 5,
6 "successful": 5,
7 "skipped": 0,
8 "failed": 0
9 },
10 "hits": {
11 "total": 28,
12 "max_score": 1.0,
13 "hits": [
14 {
15 "_index": "editorial-preview_v1",
16 "_type": "_doc",
17 "_id": "f4a1af43fed0b4e246abb3a8c7d7323d",
18 "_score": 1.0,
19 "_source": {
20 "localId": "/site/components/articles-widget/latest-articles-widget.xml"
21 }
22 }
23 ]
24 }
25}
Responses
Status
|
Location
|
Response Body
|
---|---|---|
200
|
See example above.
|
|
500
|
"Internal server error" |