# How to control the "\_indexed\_chars" value on a Ingest Attachment pipeline?

**URL:** <https://discuss.elastic.co/t/how-to-control-the-indexed-chars-value-on-a-ingest-attachment-pipeline/123073>\
**Category:** Elasticsearch\
**Created:** [March 8, 2018, 1:09pm UTC](https://discuss.elastic.co/t/how-to-control-the-indexed-chars-value-on-a-ingest-attachment-pipeline/123073 "2018-03-08T13:09:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cornoualis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cornoualis/32/23246_2.png) [@Cornoualis](https://discuss.elastic.co/u/Cornoualis)\
**Post date:** [March 8, 2018, 1:09pm UTC](https://discuss.elastic.co/t/how-to-control-the-indexed-chars-value-on-a-ingest-attachment-pipeline/123073/1 "2018-03-08T13:09:24Z")

</div>

Hi,

I created a pipeline to ingest office/pdf files using the Ingest Attachment pipeline without defining a value for "indexed\_chars" (so I guess that the default value of 100k chars is used).

```
PUT _ingest/pipeline/attachment
{
  "description" : "Extract attachment information. Used to parse pdf and office files",
  "processors" : [
    {
      "attachment" : {
        "field" : "data"
      }
    }
  ]
}

```

Some of my users want to be able to use a per document value, as described [here](https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/mapper-attachments-indexed-characters.html#mapper-attachments-indexed-characters) for the Mapper plugin.

Is it possible to the the same with the Ingest Attachment plugin?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 8, 2018, 1:24pm UTC](https://discuss.elastic.co/t/how-to-control-the-indexed-chars-value-on-a-ingest-attachment-pipeline/123073/2 "2018-03-08T13:24:33Z")

</div>

See [https://www.elastic.co/guide/en/elasticsearch/plugins/6.2/using-ingest-attachment.html](https://www.elastic.co/guide/en/elasticsearch/plugins/6.2/using-ingest-attachment.html)

---

<div class="post-metadata">

**Author:** ![Cornoualis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cornoualis/32/23246_2.png) [@Cornoualis](https://discuss.elastic.co/u/Cornoualis)\
**Post date:** [March 8, 2018, 2:30pm UTC](https://discuss.elastic.co/t/how-to-control-the-indexed-chars-value-on-a-ingest-attachment-pipeline/123073/3 "2018-03-08T14:30:59Z")

</div>

Thank you David,  
I read this doc already, but it doesn't answer the question about the "per document" aspect.

If the "indexed\_chars" can only be set at the pipeline definition level, I would have to set it to "-1" to ensure that all my users will be able to index anything...but it's a risk to crash the ingesting node if somebody sends an extremely big file.

That's why I wanted to know if "[this](https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/mapper-attachments-indexed-characters.html#mapper-attachments-indexed-characters)" was doable with Ingest Attachment plugin or not.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 8, 2018, 2:48pm UTC](https://discuss.elastic.co/t/how-to-control-the-indexed-chars-value-on-a-ingest-attachment-pipeline/123073/4 "2018-03-08T14:48:05Z")

</div>

I see.

That's indeed not doable AFAIK. May be something we can support as an option like reading this limit value from the document itself by adding a setting like `field_indexed_chars`.

Then we could do something:

```auto
PUT _ingest/pipeline/attachment
{
  "description" : "Extract attachment information. Used to parse pdf and office files",
  "processors" : [
    {
      "attachment" : {
        "field" : "data",
        "field_indexed_chars" : "size"
      }
    }
  ]
}

```

Then index either:

```auto
PUT index/doc/1?pipeline=attachment
{
  "data": "BASE64"
}

```

Which will use the default value (or the one defined by `indexed_chars`)

Or

```auto
PUT index/doc/2?pipeline=attachment
{
  "data": "BASE64",
  "size": 1000 
}

```

Would you like to open a feature request for it?

---

<div class="post-metadata">

**Author:** ![Cornoualis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cornoualis/32/23246_2.png) [@Cornoualis](https://discuss.elastic.co/u/Cornoualis)\
**Post date:** [March 8, 2018, 3:15pm UTC](https://discuss.elastic.co/t/how-to-control-the-indexed-chars-value-on-a-ingest-attachment-pipeline/123073/5 "2018-03-08T15:15:02Z")

</div>

If it's possible, yes, I'd like a feature request!

Many thanks!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 8, 2018, 4:07pm UTC](https://discuss.elastic.co/t/how-to-control-the-indexed-chars-value-on-a-ingest-attachment-pipeline/123073/6 "2018-03-08T16:07:13Z")

</div>

I opened

> <https://github.com/elastic/elasticsearch/issues/28942>

Let's see how it goes.

---

<div class="post-metadata">

**Author:** ![Cornoualis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cornoualis/32/23246_2.png) [@Cornoualis](https://discuss.elastic.co/u/Cornoualis)\
**Post date:** [March 8, 2018, 4:08pm UTC](https://discuss.elastic.co/t/how-to-control-the-indexed-chars-value-on-a-ingest-attachment-pipeline/123073/7 "2018-03-08T16:08:28Z")

</div>

Thank you David!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 14, 2018, 6:33pm UTC](https://discuss.elastic.co/t/how-to-control-the-indexed-chars-value-on-a-ingest-attachment-pipeline/123073/8 "2018-03-14T18:33:34Z")

</div>

FYI I merged this today:

> <https://github.com/elastic/elasticsearch/pull/28977>

Should be available in 6.3.0 and later. 💥

---

<div class="post-metadata">

**Author:** ![Cornoualis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cornoualis/32/23246_2.png) [@Cornoualis](https://discuss.elastic.co/u/Cornoualis)\
**Post date:** [March 15, 2018, 11:40am UTC](https://discuss.elastic.co/t/how-to-control-the-indexed-chars-value-on-a-ingest-attachment-pipeline/123073/9 "2018-03-15T11:40:18Z")

</div>

Great! Thanks a lot David! 👏👏

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 12, 2018, 11:40am UTC](https://discuss.elastic.co/t/how-to-control-the-indexed-chars-value-on-a-ingest-attachment-pipeline/123073/10 "2018-04-12T11:40:37Z")

</div>

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