Index a document using an index profile
import requests
url = "https://{FUSION_HOST}:8764/api/apollo/index/{id}"
headers = {"Content-Type": "application/vnd.lucidworks-document"}
response = requests.post(url, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://{FUSION_HOST}:8764/api/apollo/index/{id}")
.header("Content-Type", "application/vnd.lucidworks-document")
.asString();const options = {
method: 'POST',
headers: {'Content-Type': 'application/vnd.lucidworks-document'}
};
fetch('https://{FUSION_HOST}:8764/api/apollo/index/{id}', 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}:8764/api/apollo/index/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/vnd.lucidworks-document'
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{FUSION_HOST}:8764/api/apollo/index/{id}"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Content-Type", "application/vnd.lucidworks-document")
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_PORT => "8764",
CURLOPT_URL => "https://{FUSION_HOST}:8764/api/apollo/index/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Content-Type: application/vnd.lucidworks-document"
],
]);
$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}:8764/api/apollo/index/{id} \
--header 'Content-Type: application/vnd.lucidworks-document'{
"docs": [
{
"id": "<string>",
"fields": [
{
"name": "<string>",
"value": {},
"metadata": {},
"annotations": [
{
"type": "<string>",
"start": 123,
"end": 123,
"features": {},
"label": "<string>",
"featureCount": 123
}
]
}
],
"metadata": {},
"commands": [
{
"name": "<string>",
"params": {}
}
],
"hints": {}
}
],
"stats": {}
}Index a document using an index profile
POST
/
index
/
{id}
Index a document using an index profile
import requests
url = "https://{FUSION_HOST}:8764/api/apollo/index/{id}"
headers = {"Content-Type": "application/vnd.lucidworks-document"}
response = requests.post(url, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://{FUSION_HOST}:8764/api/apollo/index/{id}")
.header("Content-Type", "application/vnd.lucidworks-document")
.asString();const options = {
method: 'POST',
headers: {'Content-Type': 'application/vnd.lucidworks-document'}
};
fetch('https://{FUSION_HOST}:8764/api/apollo/index/{id}', 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}:8764/api/apollo/index/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/vnd.lucidworks-document'
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{FUSION_HOST}:8764/api/apollo/index/{id}"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Content-Type", "application/vnd.lucidworks-document")
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_PORT => "8764",
CURLOPT_URL => "https://{FUSION_HOST}:8764/api/apollo/index/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Content-Type: application/vnd.lucidworks-document"
],
]);
$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}:8764/api/apollo/index/{id} \
--header 'Content-Type: application/vnd.lucidworks-document'{
"docs": [
{
"id": "<string>",
"fields": [
{
"name": "<string>",
"value": {},
"metadata": {},
"annotations": [
{
"type": "<string>",
"start": 123,
"end": 123,
"features": {},
"label": "<string>",
"featureCount": 123
}
]
}
],
"metadata": {},
"commands": [
{
"name": "<string>",
"params": {}
}
],
"hints": {}
}
],
"stats": {}
}Path Parameters
The ID of the index profile to use
Query Parameters
If true, documents are not sent to Solr for indexing; the solr-index stage will be skipped
If true, return the list of documents indexed; otherwise no output is returned when the pipeline has finished
The maximum number of documents to list in the output
Was this page helpful?