Actions52
- Advanced Actions
- Api Keys Actions
- Clusters Actions
- Dictionaries Actions
- Indices Actions
- Records Actions
- Rules Actions
- Search Actions
- Synonyms Actions
- Vaults Actions
Overview
The "Delete by" operation under the "Records" resource in this Algolia node allows users to delete multiple records from a specified index based on filter criteria rather than individual object IDs. This operation is useful when you want to remove records that match certain conditions or filters without needing to know their exact identifiers.
Typical use cases include:
- Cleaning up records that meet specific attribute filters (e.g., all records tagged as "expired").
- Bulk deletion of records within a geographic area or matching numeric constraints.
- Removing records that satisfy complex filter expressions combining facets, tags, and numeric filters.
This operation is resource-intensive and should be used only when you cannot obtain object IDs for targeted deletions. For better efficiency, it is recommended to retrieve object IDs via browsing and then delete them using batch operations.
Properties
| Name | Meaning |
|---|---|
| Index Name | The name of the Algolia index where records will be deleted. This is required. |
| Multiple properties | Allows specifying multiple filter-related properties to define which records to delete. Options include: Facet Filters, Filters, Numeric Filters, Tag Filters, Around Lat Lng, Around Radius, Inside Bounding Box, Inside Polygon. |
| Facet Filters | Filter records by facet attributes. Can be provided as an array or string. Facet filters allow filtering based on categorical attributes. |
| Filters | A filter expression string to include items matching specific criteria. Supports numeric filters, ranges, facet filters, tag filters, boolean filters, and logical operators with some restrictions. Example: (category:Book OR category:Ebook) AND _tags:published. |
| Numeric Filters | Numeric-based filters to restrict records by numerical attribute values. Can be provided as an array or string. |
| Tag Filters | Filters based on tags associated with records. Can be provided as an array or string. Tags are case-sensitive. |
| Around Lat Lng | Coordinates (latitude, longitude) defining the center of a circular geographic area. Only records within this circle are included. Expressed as a comma-separated string, e.g., "40.71,-74.01". Ignored if insidePolygon or insideBoundingBox is also specified. |
| Around Radius | Defines the radius around the Around Lat Lng center in meters to include records. Can be an integer or "all" to include all records with valid geolocation. |
| Inside Bounding Box | Defines one or more rectangular geographic areas to include records inside. Each bounding box is defined by two opposite points of its diagonal as [lat1, lng1, lat2, lng2]. Multiple bounding boxes can be provided as nested arrays. Can be provided as a string, null, or array. |
| Inside Polygon | Defines one or more polygonal geographic areas to include records inside. Polygons consist of 3 to 10,000 points represented by latitude and longitude pairs. Multiple polygons can be provided as nested arrays. Ignored if insideBoundingBox is specified. |
Output
The output of this operation typically includes JSON data indicating the result of the delete-by-query request. This usually contains information such as task status or confirmation that the deletion request was accepted. The node does not output binary data.
Dependencies
- Requires an API key credential with appropriate permissions to perform record deletions on the specified Algolia index.
- Requires the Algolia Application ID and API key configured in n8n credentials.
- The base URL for API requests is constructed using the Algolia Application ID.
Troubleshooting
- Empty Filters Error: The delete-by-query operation does not accept empty filters. Ensure that at least one filter property is set; otherwise, the API will reject the request.
- Resource Intensive Operation: This operation can be slow and consume significant resources. For large datasets, consider retrieving object IDs first and deleting them in batches.
- Permission Issues: Ensure the API key used has sufficient permissions to delete records in the target index.
- Invalid Filter Syntax: Filters must follow Algolia's syntax rules. Invalid filter expressions will cause errors.
- Geolocation Parameters Conflicts: If both
insidePolygonandinsideBoundingBoxare specified,insidePolygonis ignored. Use only one of these geographic filters at a time.