Indices
Update
Updates a search engine index.
PATCH
/
api
/
v2
/
search_engines
/
{hashid}
/
indices
/
{name}
Update
curl --request PATCH \
--url https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"datasources": [
{
"type": "file",
"options": {
"url": "https://yourserver/your_data_feed.xml"
}
}
]
}
'import requests
url = "https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}"
payload = { "datasources": [
{
"type": "file",
"options": { "url": "https://yourserver/your_data_feed.xml" }
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
datasources: [{type: 'file', options: {url: 'https://yourserver/your_data_feed.xml'}}]
})
};
fetch('https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'datasources' => [
[
'type' => 'file',
'options' => [
'url' => 'https://yourserver/your_data_feed.xml'
]
]
]
]),
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}"
payload := strings.NewReader("{\n \"datasources\": [\n {\n \"type\": \"file\",\n \"options\": {\n \"url\": \"https://yourserver/your_data_feed.xml\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"datasources\": [\n {\n \"type\": \"file\",\n \"options\": {\n \"url\": \"https://yourserver/your_data_feed.xml\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"datasources\": [\n {\n \"type\": \"file\",\n \"options\": {\n \"url\": \"https://yourserver/your_data_feed.xml\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "product",
"preset": "product",
"datasources": [
{
"type": "file",
"options": {
"url": "https://yourserver/your_data_feed.xml"
}
}
]
}{
"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_locked",
"message": "Search engine is being processed"
}
}{
"error": {
"code": "too_many_requests",
"message": "Too many requests per second"
}
}{
"error": {
"code": "unexpected_error",
"message": "An unexpected error has ocurred"
}
}{
"error": {
"code": "service_unavailable",
"message": "An internal service required to complete the request failed"
}
}Authorizations
api_tokenjwt_token
Path Parameters
Body
application/json
Response
Index was updated.
Set of options and parameters of an index. They define the way an index is built.
Preset of the index. The preset defines a set of configuration parameters for the index like basic fields to be included, and field transformations. For instance, the product preset creates the best_price field.
Available options:
generic, product, page, category Example:
"product"
⌘I
Update
curl --request PATCH \
--url https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"datasources": [
{
"type": "file",
"options": {
"url": "https://yourserver/your_data_feed.xml"
}
}
]
}
'import requests
url = "https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}"
payload = { "datasources": [
{
"type": "file",
"options": { "url": "https://yourserver/your_data_feed.xml" }
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
datasources: [{type: 'file', options: {url: 'https://yourserver/your_data_feed.xml'}}]
})
};
fetch('https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'datasources' => [
[
'type' => 'file',
'options' => [
'url' => 'https://yourserver/your_data_feed.xml'
]
]
]
]),
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}"
payload := strings.NewReader("{\n \"datasources\": [\n {\n \"type\": \"file\",\n \"options\": {\n \"url\": \"https://yourserver/your_data_feed.xml\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"datasources\": [\n {\n \"type\": \"file\",\n \"options\": {\n \"url\": \"https://yourserver/your_data_feed.xml\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{search_zone}-api.doofinder.com/api/v2/search_engines/{hashid}/indices/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"datasources\": [\n {\n \"type\": \"file\",\n \"options\": {\n \"url\": \"https://yourserver/your_data_feed.xml\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "product",
"preset": "product",
"datasources": [
{
"type": "file",
"options": {
"url": "https://yourserver/your_data_feed.xml"
}
}
]
}{
"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_locked",
"message": "Search engine is being processed"
}
}{
"error": {
"code": "too_many_requests",
"message": "Too many requests per second"
}
}{
"error": {
"code": "unexpected_error",
"message": "An unexpected error has ocurred"
}
}{
"error": {
"code": "service_unavailable",
"message": "An internal service required to complete the request failed"
}
}