# Too many clauses when indexing an attachment field

**URL:** <https://discuss.elastic.co/t/too-many-clauses-when-indexing-an-attachment-field/137684>\
**Category:** Elasticsearch\
**Created:** [June 27, 2018, 7:37pm UTC](https://discuss.elastic.co/t/too-many-clauses-when-indexing-an-attachment-field/137684 "2018-06-27T19:37:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![silversun](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@silversun](https://discuss.elastic.co/u/silversun)\
**Post date:** [June 27, 2018, 7:37pm UTC](https://discuss.elastic.co/t/too-many-clauses-when-indexing-an-attachment-field/137684/1 "2018-06-27T19:37:39Z")

</div>

I'm running Elasticsearch 2.4 for about 250 documents.

Most of those documents have **_attachments_** , and hence I am using a field called 'field\_attachment\_base64' with type 'attachment' (mapper plugin). This field contains the full-text content of those attachments in base64 format.

With the default,

> **index.query.bool.max\_clause\_count = 1024**

, I hit the error - ' **Too many clauses**'.

When I increase the value to 10240, I don't see that error anymore. Are there better alternatives to the '`Too many clauses`' issue?

Here is the field with full-text content of attachments in base64 format -

> ```
> "field_attachment_base64" : {
> "type" : "attachment",
> "fields" : {
> "content" : {
> "type" : "string",
> "store" : true
> },
> "author" : {
> "type" : "string"
> },
> "title" : {
> "type" : "string"
> },
> "name" : {
> "type" : "string"
> },
> "date" : {
> "type" : "date",
> "format" : "strict_date_optional_time||epoch_millis"
> },
> "keywords" : {
> "type" : "string"
> },
> "content_type" : {
> "type" : "string"
> },
> "content_length" : {
> "type" : "integer"
> },
> "language" : {
> "type" : "string"
> }
> }
> },
> 
> ```

---

<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:** [July 25, 2018, 7:41pm UTC](https://discuss.elastic.co/t/too-many-clauses-when-indexing-an-attachment-field/137684/2 "2018-07-25T19:41:47Z")

</div>

Closed on July 25, 2018, 7:41pm UTC

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