Create an index pipeline
import requests
url = "https://{FUSION_HOST}/api/index-pipelines"
payload = {
"id": "my-index-pipeline",
"stages": [
{
"id": "field_mapping",
"type": "field-mapping",
"reservedFieldsMappingAllowed": False
},
{
"id": "solr_dynamic_field_mapping",
"type": "solr-dynamic-field-name-mapping",
"advancedTextFieldsIndexing": True
},
{
"id": "solr_indexing",
"type": "solr-index",
"fieldsList": False
}
]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://{FUSION_HOST}/api/index-pipelines")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"my-index-pipeline\",\n \"stages\": [\n {\n \"id\": \"field_mapping\",\n \"type\": \"field-mapping\",\n \"reservedFieldsMappingAllowed\": false\n },\n {\n \"id\": \"solr_dynamic_field_mapping\",\n \"type\": \"solr-dynamic-field-name-mapping\",\n \"advancedTextFieldsIndexing\": true\n },\n {\n \"id\": \"solr_indexing\",\n \"type\": \"solr-index\",\n \"fieldsList\": false\n }\n ]\n}")
.asString();const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'my-index-pipeline',
stages: [
{
id: 'field_mapping',
type: 'field-mapping',
reservedFieldsMappingAllowed: false
},
{
id: 'solr_dynamic_field_mapping',
type: 'solr-dynamic-field-name-mapping',
advancedTextFieldsIndexing: true
},
{id: 'solr_indexing', type: 'solr-index', fieldsList: false}
]
})
};
fetch('https://{FUSION_HOST}/api/index-pipelines', 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/index-pipelines")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"my-index-pipeline\",\n \"stages\": [\n {\n \"id\": \"field_mapping\",\n \"type\": \"field-mapping\",\n \"reservedFieldsMappingAllowed\": false\n },\n {\n \"id\": \"solr_dynamic_field_mapping\",\n \"type\": \"solr-dynamic-field-name-mapping\",\n \"advancedTextFieldsIndexing\": true\n },\n {\n \"id\": \"solr_indexing\",\n \"type\": \"solr-index\",\n \"fieldsList\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{FUSION_HOST}/api/index-pipelines"
payload := strings.NewReader("{\n \"id\": \"my-index-pipeline\",\n \"stages\": [\n {\n \"id\": \"field_mapping\",\n \"type\": \"field-mapping\",\n \"reservedFieldsMappingAllowed\": false\n },\n {\n \"id\": \"solr_dynamic_field_mapping\",\n \"type\": \"solr-dynamic-field-name-mapping\",\n \"advancedTextFieldsIndexing\": true\n },\n {\n \"id\": \"solr_indexing\",\n \"type\": \"solr-index\",\n \"fieldsList\": false\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION_HOST}/api/index-pipelines",
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([
'id' => 'my-index-pipeline',
'stages' => [
[
'id' => 'field_mapping',
'type' => 'field-mapping',
'reservedFieldsMappingAllowed' => false
],
[
'id' => 'solr_dynamic_field_mapping',
'type' => 'solr-dynamic-field-name-mapping',
'advancedTextFieldsIndexing' => true
],
[
'id' => 'solr_indexing',
'type' => 'solr-index',
'fieldsList' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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/index-pipelines \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "my-index-pipeline",
"stages": [
{
"id": "field_mapping",
"type": "field-mapping",
"reservedFieldsMappingAllowed": false
},
{
"id": "solr_dynamic_field_mapping",
"type": "solr-dynamic-field-name-mapping",
"advancedTextFieldsIndexing": true
},
{
"id": "solr_indexing",
"type": "solr-index",
"fieldsList": false
}
]
}
'{
"id": "my-index-pipeline",
"stages": [
{
"id": "field_mapping",
"translationMappings": [],
"retentionMappings": [],
"updateMappings": [],
"unmappedRule": {
"keep": true,
"delete": false,
"fieldToMoveValuesTo": "",
"fieldToCopyValuesTo": "",
"valueToAddToUnmappedFields": "",
"valueToSetOnUnmappedFields": ""
},
"reservedFieldsMappingAllowed": false,
"type": "field-mapping",
"skip": false,
"secretSourceStageId": "field_mapping"
},
{
"id": "solr_dynamic_field_mapping",
"duplicateSingleValuedFields": false,
"fieldsToExclude": [],
"advancedTextFieldsIndexing": true,
"maxTextLengthForAdvancedIndexing": 100,
"type": "solr-dynamic-field-name-mapping",
"skip": false,
"secretSourceStageId": "solr_dynamic_field_mapping"
},
{
"id": "solr_indexing",
"enforceSchema": true,
"fieldsList": false,
"dateFormats": [],
"params": [],
"bufferDocsForSolr": true,
"allowBlacklistedRequestParameters": false,
"type": "solr-index",
"skip": false,
"secretSourceStageId": "solr_indexing"
}
],
"properties": {
"secretSourcePipelineId": "my-index-pipeline"
}
}Create an index pipeline
The request is a JSON body defining the new index pipeline. Only the id field is required to create a pipeline with no stages. Include a stages array with at least the type and id field per stage to create a working pipeline.
POST
/
index-pipelines
Create an index pipeline
import requests
url = "https://{FUSION_HOST}/api/index-pipelines"
payload = {
"id": "my-index-pipeline",
"stages": [
{
"id": "field_mapping",
"type": "field-mapping",
"reservedFieldsMappingAllowed": False
},
{
"id": "solr_dynamic_field_mapping",
"type": "solr-dynamic-field-name-mapping",
"advancedTextFieldsIndexing": True
},
{
"id": "solr_indexing",
"type": "solr-index",
"fieldsList": False
}
]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://{FUSION_HOST}/api/index-pipelines")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"my-index-pipeline\",\n \"stages\": [\n {\n \"id\": \"field_mapping\",\n \"type\": \"field-mapping\",\n \"reservedFieldsMappingAllowed\": false\n },\n {\n \"id\": \"solr_dynamic_field_mapping\",\n \"type\": \"solr-dynamic-field-name-mapping\",\n \"advancedTextFieldsIndexing\": true\n },\n {\n \"id\": \"solr_indexing\",\n \"type\": \"solr-index\",\n \"fieldsList\": false\n }\n ]\n}")
.asString();const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'my-index-pipeline',
stages: [
{
id: 'field_mapping',
type: 'field-mapping',
reservedFieldsMappingAllowed: false
},
{
id: 'solr_dynamic_field_mapping',
type: 'solr-dynamic-field-name-mapping',
advancedTextFieldsIndexing: true
},
{id: 'solr_indexing', type: 'solr-index', fieldsList: false}
]
})
};
fetch('https://{FUSION_HOST}/api/index-pipelines', 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/index-pipelines")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"my-index-pipeline\",\n \"stages\": [\n {\n \"id\": \"field_mapping\",\n \"type\": \"field-mapping\",\n \"reservedFieldsMappingAllowed\": false\n },\n {\n \"id\": \"solr_dynamic_field_mapping\",\n \"type\": \"solr-dynamic-field-name-mapping\",\n \"advancedTextFieldsIndexing\": true\n },\n {\n \"id\": \"solr_indexing\",\n \"type\": \"solr-index\",\n \"fieldsList\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{FUSION_HOST}/api/index-pipelines"
payload := strings.NewReader("{\n \"id\": \"my-index-pipeline\",\n \"stages\": [\n {\n \"id\": \"field_mapping\",\n \"type\": \"field-mapping\",\n \"reservedFieldsMappingAllowed\": false\n },\n {\n \"id\": \"solr_dynamic_field_mapping\",\n \"type\": \"solr-dynamic-field-name-mapping\",\n \"advancedTextFieldsIndexing\": true\n },\n {\n \"id\": \"solr_indexing\",\n \"type\": \"solr-index\",\n \"fieldsList\": false\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION_HOST}/api/index-pipelines",
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([
'id' => 'my-index-pipeline',
'stages' => [
[
'id' => 'field_mapping',
'type' => 'field-mapping',
'reservedFieldsMappingAllowed' => false
],
[
'id' => 'solr_dynamic_field_mapping',
'type' => 'solr-dynamic-field-name-mapping',
'advancedTextFieldsIndexing' => true
],
[
'id' => 'solr_indexing',
'type' => 'solr-index',
'fieldsList' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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/index-pipelines \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "my-index-pipeline",
"stages": [
{
"id": "field_mapping",
"type": "field-mapping",
"reservedFieldsMappingAllowed": false
},
{
"id": "solr_dynamic_field_mapping",
"type": "solr-dynamic-field-name-mapping",
"advancedTextFieldsIndexing": true
},
{
"id": "solr_indexing",
"type": "solr-index",
"fieldsList": false
}
]
}
'{
"id": "my-index-pipeline",
"stages": [
{
"id": "field_mapping",
"translationMappings": [],
"retentionMappings": [],
"updateMappings": [],
"unmappedRule": {
"keep": true,
"delete": false,
"fieldToMoveValuesTo": "",
"fieldToCopyValuesTo": "",
"valueToAddToUnmappedFields": "",
"valueToSetOnUnmappedFields": ""
},
"reservedFieldsMappingAllowed": false,
"type": "field-mapping",
"skip": false,
"secretSourceStageId": "field_mapping"
},
{
"id": "solr_dynamic_field_mapping",
"duplicateSingleValuedFields": false,
"fieldsToExclude": [],
"advancedTextFieldsIndexing": true,
"maxTextLengthForAdvancedIndexing": 100,
"type": "solr-dynamic-field-name-mapping",
"skip": false,
"secretSourceStageId": "solr_dynamic_field_mapping"
},
{
"id": "solr_indexing",
"enforceSchema": true,
"fieldsList": false,
"dateFormats": [],
"params": [],
"bufferDocsForSolr": true,
"allowBlacklistedRequestParameters": false,
"type": "solr-index",
"skip": false,
"secretSourceStageId": "solr_indexing"
}
],
"properties": {
"secretSourcePipelineId": "my-index-pipeline"
}
}Authorizations
Basic authAPI key
Query Parameters
Body
application/json
A JSON object defining the index pipeline.
Response
201 - application/json
Created
A JSON object defining the index pipeline.
Was this page helpful?