Methods
(static) createBaseRequest(url, parameterValues) → {module:opensearch/search.BaseRequest}
Returns an object that can be transformed into a fetch Request or an
XMLHttpRequest.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | The url to send the search request to. |
parameterValues |
object | The search parameter values. |
Returns:
The constructed base request object.
(static) search(url, parametersopt, typeopt, rawopt, maxUrlLengthopt) → {Promise.<SearchResult>|Promise.<Response>}
Performs a search for the given URL and parameters.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
url |
OpenSearchUrl | The URL to search on. | ||
parameters |
object |
<optional> |
{} | The search parameters. |
type |
string |
<optional> |
null | The response format. |
raw |
boolean |
<optional> |
false | Whether the response shall be parsed or returned raw. |
maxUrlLength |
number |
<optional> |
The maximum URL length. URLs longer than that will result in errors. |
Returns:
The search result as a Promise
- Type
- Promise.<SearchResult> | Promise.<Response>
Type Definitions
BaseRequest
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
url |
string | The URL of the search service. | |
method |
string | The ussed HTTP method. | |
headers |
object |
<optional> |
Optional HTTP headers. |
body |
string | FormData |
<optional> |
The body to be sent to the search service. (For HTTP POST requests) |