# Slow handling of documents when large text in a field

**URL:** <https://discuss.elastic.co/t/slow-handling-of-documents-when-large-text-in-a-field/302431>\
**Category:** Logstash\
**Created:** [April 14, 2022, 12:34pm UTC](https://discuss.elastic.co/t/slow-handling-of-documents-when-large-text-in-a-field/302431 "2022-04-14T12:34:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lubosvr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lubosvr/32/104400_2.png) [@lubosvr](https://discuss.elastic.co/u/lubosvr)\
**Post date:** [April 14, 2022, 12:34pm UTC](https://discuss.elastic.co/t/slow-handling-of-documents-when-large-text-in-a-field/302431/1 "2022-04-14T12:34:54Z")

</div>

Hi,  
We have problems when handling for documents with large content in a single field.

We have index with mapping like this:

```auto
    "mappings" : {
      "dynamic" : "false",...
      "properties" : {
        "created" : {
          "type" : "date"
        },...
        "systemMetadata" : {
          "dynamic" : "false",
          "properties" : {
            "name" : {
              "properties" : {
                "bothStringValue" : {
                  "type" : "text",
                  "fields" : {
                    "ft3" : {
                      "type" : "text",
                      "analyzer" : "my_analyzer3"
                    },
                    "ft5" : {
                      "type" : "text",
                      "analyzer" : "my_analyzer5"
                    },...
                  },
                  "analyzer" : "my_analyzer"
                }
              }
            },
            "searchContentHTML" : {
              "properties" : {
                "textValue" : {
                  "type" : "text",
                  "fields" : {
                    "ft3" : {
                      "type" : "text",
                      "analyzer" : "my_analyzer3"
                    },
                    "ft5" : {...
            },...

```

The problem is that inside `systemMetadata.searchContentHTML` can be quite a long text (MBs) that we are basically using for fulltext search only. (Hardly to be usefull for returning to clients)  
When the text is about 14MB long the `getById` query (with `_source_excludes=systemMetadata.searchContentHTML` parameter) takes about 130ms and when the text is small is takes 25ms.

Are there any good practices how to handle such document with Elasticsearch?

---

<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:** [May 12, 2022, 12:35pm UTC](https://discuss.elastic.co/t/slow-handling-of-documents-when-large-text-in-a-field/302431/2 "2022-05-12T12:35:08Z")

</div>

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