...
Info |
---|
The term bulk operation implies the variety of operations which may be performed in a single request. For the limit of items, goto https://hawksearch.atlassian.net/wiki/spaces/HSKB/pages/1807155201/ Bulk + Operations +API#LimitsAPI | Limits |
This is achieved by sending a request to the indexing API to the URL:
Endpoint | Method | Header Key |
---|---|---|
api/v2/indexing/bulk-item-operations | POST | X-HawkSearch-ApiKey |
There are three operations which are part of bulk operations API described as follows.
Request
Name | Datatype | Required | Description |
---|---|---|---|
IndexName | String | yes | The name of the index to which the item(s) should be added. |
Operations | Array of objects | yes | The Operations variable holds the operation-specific objects. At-least one operation object is required |
>OperationType | String | yes | The name of the bulk operation to be performed. One of the four options are available:
|
>Items | Array of item objects | yes if the operation type is not delete-items | The items on which the bulk operations are performed on Hawksearch. |
>>id | Alphanumeric | yes if the operation type is not delete-items | The unique id of the item |
>>{{property name}} | Alphanumeric | yes if the operation type is not delete-items | the attribute name for which the values need to be assigned |
>Ids | Array of Strings | yes if the operation type is delete-items | The unique_ids of the items which need to be removed from Hawksearch index. |
Methods
Add attribute to Items
...
We can use this method to remove multiple items at the same time.
Limits
Operations: there cannot be more than 125 operations per request
Items: there cannot be 125 items per operation
Total: the max limit is 125 operations x 125 items per operation = 15625 items per one bulk operations request
Example:
Note that we may also combine these operations in a single request:
...