Indices
Create temporary index
Creates a new empty temporary index for the same index name. There can not be two temporary indices at the same time, so any request made to this endpoint when there is one created will fail. Creating a temporary index also sets a lock preventing any changes on the search engine until the temporary index is deleted.
POST
/
api
/
v2
/
search_engines
/
{hashid}
/
indices
/
{name}
/
temp
/
Create temporary index
curl --request POST \
--url https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/ \
--header 'Authorization: <api-key>'import requests
url = "https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/', 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}/temp/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "OK"
}{
"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": "too_many_temporary",
"message": "A temporary index already exists for this index"
}
}{
"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_]*$Response
Temporary index created.
The response is of type object.
Previous
Delete temporary indexDeletes the temporary index. This also removes the lock in the search
engine. If there is no temporary index this will return a 404 (Not found).
Next
⌘I
Create temporary index
curl --request POST \
--url https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/ \
--header 'Authorization: <api-key>'import requests
url = "https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/', 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}/temp/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}/temp/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "OK"
}{
"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": "too_many_temporary",
"message": "A temporary index already exists for this index"
}
}{
"error": {
"code": "too_many_requests",
"message": "Too many requests"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error"
}
}