Skip to main content
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_body
package 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

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Query Parameters

context
string

The app to which this object belongs, as app:SomeApp. If the app doesn't exist, the request fails. Other comma-separated contexts in the context parameter are allowed but ignored.

Body

application/json

A JSON object defining the index pipeline.

id
string

The index pipeline ID.

Example:

"default"

stages
object[]

The stages in this index pipeline and their configurations. Use /api/index-stages/schema and /api/index-stages/schema/{type} to get the configuration schemas for the available index stage types.

properties
object

Additional properties defining this index pipeline.

Response

201 - application/json

Created

A JSON object defining the index pipeline.

id
string

The index pipeline ID.

Example:

"default"

stages
object[]

The stages in this index pipeline and their configurations. Use /api/index-stages/schema and /api/index-stages/schema/{type} to get the configuration schemas for the available index stage types.

properties
object

Additional properties defining this index pipeline.