Search API
Search
POST
https://api-eu.attraqt.io/search
Search for items using the XO Search engine.
Request Body
Name | Type | Description |
---|---|---|
token | string | XO Search token (can be found in the XO Console) |
query | string | The query string used for the search |
options.offset | integer | Pagination: \ If specified, only fetch results starting from this offset. It should be a multiple of
parameter. \ Defaults to 0. \ Check Pagination page for more info. |
options.limit | integer | Pagination: \ If specified, fetch the specified number of results per page. Should be used in conjunction with
. \ Defaults to 10. \ Check Pagination page for more info. |
options.sortBy | array | Sorting: \ Sort the results using the specified sort options. \ Defaults to an empty array (no sort applied, ie. results are sorted by relevancy). \ Check Sorting page for more info about the
array format. |
options.facets | array | Faceting: \ Filters the results that match the provided facets names and values. \ Defaults to an empty array (no filter applied). \ Check Faceting page for more info about the
array format. |
options.filter | string | Filtering: \ Filters the results based on the filter query (SQL-like syntax). \ Defaults to an empty array (no filter applied). \ Check Filtering page for more info about the
string format. |
options.customResponseMask | string | Attributes to retrieve: \ If specified, you have the control which attributes to retrieve and which not to retrieve. |
options.disable | array | Disable features: \ If specified, disable features from the query. \ Check Disable features page for more info about the
array format. |
Example search request
The following sample request includes all possible parameters you can use
Search
GET
https://api-eu.attraqt.io/search/:token
Same as the
POST
method. The
token
must be specified in the
URL
path. Other parameters should be url-encoded and send as a single query parameter.
Path Parameters
Name | Type | Description |
---|---|---|
token | string | XO Search token (can be found in the XO Console) |
Query Parameters
Name | Type | Description |
---|---|---|
encoded | string | Every other parameters (as specified in the POST method), as a URL-encoded JSON object. |
Response
The search response contains two parts:
Property | Type | Description |
---|---|---|
|
| Array of fetched items from the catalog |
|
| Metadata about the search request: available facets, pagination, number of items, elapsed time, ... |
items
items
The items matching the search query.
Property | Type | Description |
---|---|---|
|
| ID of the item |
|
| Relevancy score of the item. Higher is better |
|
| If present, contains the item's attributes, as specified in the XO catalog |
|
| If present, a search redirect was triggered, and contains the redirect information |
metadata
metadata
Metadata about the search query and its results.
Property | Type | Description |
---|---|---|
|
| Number of items matching the query |
|
| Time the request took to complete (in milliseconds) |
|
| Search API token used for the request |
|
| Equivalent url that can be used to send the same request |
|
| Pagination: index of the first fetched item |
|
| Pagination: Size of the page (ie. number of elements returned) |
|
| List of facets (and their values) matching the query. Facets must be defined in the XO console. |
|
| Unique identifier |
|
| Search configuration id used |
|
| If true, the count of the results is exact |
Example
Last updated