Simple search query. Supports pagination.
The query string is expected to be a valid Elastic Search query string.| name | type | description | default | constraints |
|---|---|---|---|---|
| defaultoperator | query | the default boolean operator to use on terms in the search query (optional) | OR | |
| fields | query | comma-separated list of fields to include in each result record (optional).
To exclude a field, prepend a minus to a field name; use no prefix to include it.
|
||
| from | query | the first result to include (optional) | int | |
| limit | query | alias of size (optional) |
-1 | int |
| offset | query | alias of from (optional) |
0 | int |
| q | query | search query to run | * | |
| size | query | the number of results to return, -1 for default page size (optional) | int | |
| sort | query | the field and order to sort on (optional).
To sort in descending order, prepend a minus to the field name. Examples:
|
| code | condition |
|---|---|
| 400 | The search query is syntactically incorrect. |
| 422 | The pagination size limit is exceeded. |
| media type | data type | description |
|---|---|---|
| application/json | ApiSearchResult (JSON) |
GET /collection/search
Content-Type: */*
Accept: application/json
...
HTTP/1.1 200 OK
Content-Type: application/json
{
"results" : [ {
"property1" : { },
"property2" : { }
}, {
"property1" : { },
"property2" : { }
} ],
"facets" : {
"property1" : { },
"property2" : { }
},
"_metadata" : {
"query" : {
"property1" : { },
"property2" : { }
},
"resultset" : {
"count" : 10,
"from" : 2,
"size" : 8,
"truncated" : true
}
}
}
Advanced search query. Supports pagination.
The query string is expected to be a valid Elastic Search query string.| media type | data type |
|---|---|
| application/json | ApiSearchRequest (JSON) |
| code | condition |
|---|---|
| 200 | The search query was executed successfully. |
| 400 | The search query is syntactically incorrect. |
| 422 | The pagination size limit is exceeded. |
| media type | data type | description |
|---|---|---|
| application/json | ApiSearchResult (JSON) | ApiSearchResult |
POST /collection/search
Content-Type: application/json
Accept: application/json
{
"query" : "James Cook",
"defaultOperator" : "AND",
"from" : 25,
"size" : 10,
"fields" : [ {
"include" : true,
"field" : "title",
"exclude" : true
}, {
"include" : true,
"field" : "_meta.*",
"exclude" : false
} ],
"facets" : [ {
"field" : "birthPlace",
"size" : 3
}, {
"field" : "birthDate",
"size" : 5
} ],
"filters" : [ {
"field" : "birthPlace",
"keyword" : "London"
}, {
"field" : "birthDate",
"keyword" : "1987"
} ],
"sort" : [ {
"field" : "title",
"order" : "asc"
}, {
"field" : "_meta.modified",
"order" : "desc"
} ]
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"results" : [ {
"property1" : { },
"property2" : { }
}, {
"property1" : { },
"property2" : { }
} ],
"facets" : {
"property1" : { },
"property2" : { }
},
"_metadata" : {
"query" : {
"property1" : { },
"property2" : { }
},
"resultset" : {
"count" : 10,
"from" : 2,
"size" : 8,
"truncated" : true
}
}
}
Start a scroll for bulk data retrieval. The resulting temporary resource will be available for up to the given amount of time.
A scroll request is very similar to a search request, but instead of allowing to specify pagination, a Location and Link header is returned with the unique, temporary URI to the next page.| name | type | description | default | constraints |
|---|---|---|---|---|
| defaultoperator | query | the default boolean operator to use on terms in the search query (optional) | OR | |
| duration | query | the duration this scroll should be available for in minutes | 1 | int |
| fields | query | list of fields to include in each result record (optional) | ||
| q | query | search query to run (optional) | * | |
| size | query | the size of each individual scroll response (optional) | 1000 | int |
| code | condition |
|---|---|
| 303 | The scroll was initiated. See Location or Link header for the next temporary scroll location. |
| 400 | The search query is syntactically incorrect. |
| 422 | The scroll duration limit is exceeded. |
| media type | data type | description |
|---|---|---|
| application/json | ApiSearchResult (JSON) |
POST /collection/search/_scroll
Content-Type: */*
Accept: application/json
...
HTTP/1.1 303 See Other
Content-Type: application/json
{
"results" : [ {
"property1" : { },
"property2" : { }
}, {
"property1" : { },
"property2" : { }
} ],
"facets" : {
"property1" : { },
"property2" : { }
},
"_metadata" : {
"query" : {
"property1" : { },
"property2" : { }
},
"resultset" : {
"count" : 10,
"from" : 2,
"size" : 8,
"truncated" : true
}
}
}