PutSolrRecord 2.3.0.4.10.0.0-147

Bundle
org.apache.nifi | nifi-solr-nar
Description
Indexes the Records from a FlowFile into Solr
Tags
Apache, Put, Record, Send, Solr
Input Requirement
REQUIRED
Supports Sensitive Dynamic Properties
false
  • Additional Details for PutSolrRecord 2.3.0.4.10.0.0-147

    PutSolrRecord

    Usage Example

    This processor reads the NiFi record and indexes it into Solr as a SolrDocument. Any properties added to this processor by the user are passed to Solr on the update request. It is required that the input record reader should be specified for this processor. Additionally, if only selected fields of a record are to be indexed you can specify the field name as a comma-separated list under the fields property.

    Example: To specify specific fields of the record to be indexed:

    • Fields To Index: field1,field2,field3

    NOTE: In case of nested the field names should be prefixed with the parent field name.

    • Fields To Index: parentField1,parentField2,parentField3_childField1,parentField3_childField2

    In case of nested records, this processor would flatten all the nested records into a single solr document, the field name of the field in a child document would follow the format of {Parent Field Name}_{Child Field Name}.

    Example: For a record created from the following json:

    
        {
            "first": "Abhi",
            "last": "R",
            "grade": 8,
            "exams": {
                "subject": "Maths",
                "test" : "term1",
                "marks" : 90
            }
        }
    

    The corresponding solr document would be represented as below:

    
        {
            "first": "Abhi",
            "last": "R",
            "grade": 8,
            "exams_subject": "Maths",
            "exams_test" : "term1",
            "exams_marks" : 90
        }
    

    Similarly in case of an array of nested records, this processor would flatten all the nested records into a single solr document, the field name of the field in a child document would follow the format of {Parent Field Name}_{Child Field Name} and would be a multivalued field in the solr document. Example: For a record created from the following json:

    
        {
        "first": "Abhi",
        "last": "R",
        "grade": 8,
        "exams": [
            {
                "subject": "Maths",
                "test" : "term1",
                "marks" : 90
            },
            {
                "subject": "Physics",
                "test" : "term1",
                "marks" : 95
            }
        ]
        }
    

    The corresponding solr document would be represented as below:

    
        {
            "first": "Abhi",
            "last": "R",
            "grade": 8,
            "exams_subject": ["Maths","Physics"]
            "exams_test" : ["term1","term1"]
            "exams_marks" : [90,95]
        }
    
Properties
Dynamic Properties
Relationships
Name Description
success The original FlowFile
failure FlowFiles that failed for any reason other than Solr being unreachable
connection_failure FlowFiles that failed because Solr is unreachable