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){
"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.
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){
"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 authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Query Parameters
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
A JSON object defining the index pipeline.
The index pipeline ID.
"default"
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.
Show child attributes
Show child attributes
Additional properties defining this index pipeline.
Show child attributes
Show child attributes
Response
Created
A JSON object defining the index pipeline.
The index pipeline ID.
"default"
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.
Show child attributes
Show child attributes
Additional properties defining this index pipeline.
Show child attributes
Show child attributes
Was this page helpful?