Create a Solr configuration file
import requests
url = "https://{FUSION HOST}/api/collections/{collection}/solr-config/{path}"
payload = ["aSDinaTvuI8gbWludGxpZnk="]
headers = {"Content-Type": "*/*"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://{FUSION HOST}/api/collections/{collection}/solr-config/{path}")
.header("Content-Type", "*/*")
.body("[\n \"aSDinaTvuI8gbWludGxpZnk=\"\n]")
.asString();const options = {
method: 'POST',
headers: {'Content-Type': '*/*'},
body: JSON.stringify(['aSDinaTvuI8gbWludGxpZnk='])
};
fetch('https://{FUSION HOST}/api/collections/{collection}/solr-config/{path}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION HOST}/api/collections/{collection}/solr-config/{path}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '*/*'
request.body = "[\n \"aSDinaTvuI8gbWludGxpZnk=\"\n]"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{FUSION HOST}/api/collections/{collection}/solr-config/{path}"
payload := strings.NewReader("[\n \"aSDinaTvuI8gbWludGxpZnk=\"\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "*/*")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION HOST}/api/collections/{collection}/solr-config/{path}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'aSDinaTvuI8gbWludGxpZnk='
]),
CURLOPT_HTTPHEADER => [
"Content-Type: */*"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request POST \
--url https://{FUSION HOST}/api/collections/{collection}/solr-config/{path} \
--header 'Content-Type: */*' \
--data '
[
"aSDinaTvuI8gbWludGxpZnk="
]
'This response has no body data.Create a Solr configuration file
Upload a new Solr configuration file in the request body. As a best practice, all requests should include the Content-type in the request header.
POST
/
collections
/
{collection}
/
solr-config
/
{path}
Create a Solr configuration file
import requests
url = "https://{FUSION HOST}/api/collections/{collection}/solr-config/{path}"
payload = ["aSDinaTvuI8gbWludGxpZnk="]
headers = {"Content-Type": "*/*"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://{FUSION HOST}/api/collections/{collection}/solr-config/{path}")
.header("Content-Type", "*/*")
.body("[\n \"aSDinaTvuI8gbWludGxpZnk=\"\n]")
.asString();const options = {
method: 'POST',
headers: {'Content-Type': '*/*'},
body: JSON.stringify(['aSDinaTvuI8gbWludGxpZnk='])
};
fetch('https://{FUSION HOST}/api/collections/{collection}/solr-config/{path}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION HOST}/api/collections/{collection}/solr-config/{path}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '*/*'
request.body = "[\n \"aSDinaTvuI8gbWludGxpZnk=\"\n]"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{FUSION HOST}/api/collections/{collection}/solr-config/{path}"
payload := strings.NewReader("[\n \"aSDinaTvuI8gbWludGxpZnk=\"\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "*/*")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION HOST}/api/collections/{collection}/solr-config/{path}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'aSDinaTvuI8gbWludGxpZnk='
]),
CURLOPT_HTTPHEADER => [
"Content-Type: */*"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request POST \
--url https://{FUSION HOST}/api/collections/{collection}/solr-config/{path} \
--header 'Content-Type: */*' \
--data '
[
"aSDinaTvuI8gbWludGxpZnk="
]
'This response has no body data.Headers
An optional tag to match against the specified blob.
Path Parameters
The collection that contains the configuration files.
The path to a specific file or nested child nodes. If the file is not nested, the filename can be entered without any path information.
Pattern:
.*Query Parameters
'True' to reload the collection and make the changes available to Solr immediately.
Validate the configuration file before saving it.
Body
*/*
The content of the file to be saved.
Pattern:
^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$Response
200 - undefined
Was this page helpful?