Amine CHERIFI
Amine CHERIFI

Reputation: 1175

Apache Nifi Put data In ElasticSearch with _Parent

I'm working with Apache Nifi and trying to put data in ElasticSearch using the processor PutElasticsearch, and it worked pretty good since i tried to add a child/parent relation in elasticsearch and so add parent in my put request.

here is my mapping elasticsearch :

"mappings": {
   "myparent": {
   },
   "mychild": {
      "_parent": {
        "type": "myparent"
      },
      "properties": {
        "attr1": {
            "type": "string"
        },
        "attr2": {
            "type": "date",
            "format": "dateOptionalTime"
        },
        "attr3": {
            "type": "string"
        }
     }
   }
}

here is how i manualy insert data in "mychild" type :

POST /myindex/mychild/1?parent=[IDParent]
{
  "attr1" : "02020",
  "attr2" : "2016-10-10",
  "attr3" : "toto"
}

i didn't find how to spécify the parentID. Is there any way of doing it using PutElasticsearch other than using the processor InvokHTTP.

Thank you.

Upvotes: 1

Views: 787

Answers (1)

mattyb
mattyb

Reputation: 12093

This is not possible today (NiFi 1.1.0 and below) with the PutElasticsearch processors, so InvokeHttp is your best option for now. I have written NIFI-3284 to cover this improvement.

Upvotes: 1

Related Questions