Items
Delete in bulk
Deletes a list of items from the index in a single bulk operation.
DELETE
/
api
/
v2
/
search_engines
/
{hashid}
/
indices
/
{name}
/
items
/
_bulk
Delete in bulk
curl --request DELETE \
--url https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/items/_bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"id": "1234"
}
]
'import requests
url = "https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/items/_bulk"
payload = [{ "id": "1234" }]
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{id: '1234'}])
};
fetch('https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/items/_bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/items/_bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
[
'id' => '1234'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/items/_bulk"
payload := strings.NewReader("[\n {\n \"id\": \"1234\"\n }\n]")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/items/_bulk")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"id\": \"1234\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/items/_bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"id\": \"1234\"\n }\n]"
response = http.request(request)
puts response.read_body{
"results": [
{
"result": "updated",
"id": "1234"
}
],
"errors": false
}{
"error": {
"code": "bad_params",
"message": "Bad parameters error",
"details": [
{
"name": "language",
"fields": [
"language"
],
"reason": "is invalid"
}
]
}
}{
"error": {
"code": "not_authenticated",
"message": "Authentication required"
}
}{
"error": {
"code": "access_denied",
"message": "Access denied"
}
}{
"error": {
"code": "not_found",
"message": "Not found"
}
}{
"error": {
"code": "searchengine_timeout",
"message": "Timeout connecting to backend"
}
}{
"error": {
"code": "searchengine_locked",
"message": "Search engine is being processed"
}
}{
"error": {
"code": "too_many_items",
"message": "Body is too large (max 8 MB)"
}
}{
"error": {
"code": "too_many_items",
"message": "Too many items in bulk request (max 100)"
}
}{
"error": {
"code": "too_many_requests",
"message": "Too many requests"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error"
}
}Authorizations
api_tokenjwt_token
Doofinder API key. Pass it as: Authorization: Token <api_key>
Path Parameters
Unique id of a search engine.
Pattern:
^[a-f0-9]{32}$Name of an index.
Pattern:
^[a-z][a-z0-9_]*$Body
application/json
Required array length:
1 - 100 elementsUnique identifier of the item.
Example:
[{ "id": "1234" }]
⌘I
Delete in bulk
curl --request DELETE \
--url https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/items/_bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"id": "1234"
}
]
'import requests
url = "https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/items/_bulk"
payload = [{ "id": "1234" }]
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{id: '1234'}])
};
fetch('https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/items/_bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/items/_bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
[
'id' => '1234'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/items/_bulk"
payload := strings.NewReader("[\n {\n \"id\": \"1234\"\n }\n]")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/items/_bulk")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"id\": \"1234\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/items/_bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"id\": \"1234\"\n }\n]"
response = http.request(request)
puts response.read_body{
"results": [
{
"result": "updated",
"id": "1234"
}
],
"errors": false
}{
"error": {
"code": "bad_params",
"message": "Bad parameters error",
"details": [
{
"name": "language",
"fields": [
"language"
],
"reason": "is invalid"
}
]
}
}{
"error": {
"code": "not_authenticated",
"message": "Authentication required"
}
}{
"error": {
"code": "access_denied",
"message": "Access denied"
}
}{
"error": {
"code": "not_found",
"message": "Not found"
}
}{
"error": {
"code": "searchengine_timeout",
"message": "Timeout connecting to backend"
}
}{
"error": {
"code": "searchengine_locked",
"message": "Search engine is being processed"
}
}{
"error": {
"code": "too_many_items",
"message": "Body is too large (max 8 MB)"
}
}{
"error": {
"code": "too_many_items",
"message": "Too many items in bulk request (max 100)"
}
}{
"error": {
"code": "too_many_requests",
"message": "Too many requests"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error"
}
}