## 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]
        }