More then one attached file in to index

Hi gays,

can i define more then one attached (RFT) field in a index?
This example is for one:

PUT _ingest/pipeline/attachment
{
  "description" : "Extract attachment information",
  "processors" : [
    {
      "attachment" : {
        "field" : "data",
        "indexed_chars" : 11,
        "indexed_chars_field" : "max_size"
      }
    }
  ]
} 

I would like to do such a thing :

PUT _ingest/pipeline/attachment
{
  "description" : "Extract attachment information",
  "processors" : [
    {
      "attachment" : {
        "field" : "data1",
        "indexed_chars" : 11,
        "indexed_chars_field" : "max_size"
      },
       {
      "attachment" : {
        "field" : "data2",
        "indexed_chars" : 11,
        "indexed_chars_field" : "max_size"
      },
      {
      "attachment" : {
        "field" : "data3",
        "indexed_chars" : 11,
        "indexed_chars_field" : "max_size"
      }
    }
  ]
} 

feor each field attached to have its own structur :

  "attachment": {
       "content_type": "application / rtf",
       "language": "ro",
       "content": "Lorem",
       "content_length": 5
     }

It's possible ? If so, how?

I'd use target_field. So I'd do something like:

PUT _ingest/pipeline/attachment
{
  "description" : "Extract attachment information",
  "processors" : [
    {
      "attachment" : {
        "field" : "data1",
        "indexed_chars" : 11,
        "indexed_chars_field" : "max_size",
        "target_field": "attachment1"
      },
       {
      "attachment" : {
        "field" : "data2",
        "indexed_chars" : 11,
        "indexed_chars_field" : "max_size",
        "target_field": "attachment2"
      },
      {
      "attachment" : {
        "field" : "data3",
        "indexed_chars" : 11,
        "indexed_chars_field" : "max_size",
        "target_field": "attachment3"
      }
    }
  ]
} 

If I understood correctly the use case.

Also have a look at this:

That could help may be?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.