How to set "ignore_above" : 256 to higher value while using python elasticsearch client?

I am using python ES client to index data into my ES... I have a column which is more than 256 characters. when I create a data table viz. in kibana I get no results message if I include that lengthy column.

Below is the code I am using to index and followed are the screenshots.

image

In the below picture, I have disabled the lengthy column hence getting the result-

In the below picture, I have enabled the lengthy column hence NOT getting the result-

Below is my index mapping-

     {
      "mappings": {
    "_doc": {
      "properties": {
    "author": {
      "type": "text",
      "fields": {
        "keyword": {
          "type": "keyword",
          "ignore_above": 256
        }
      }
    },
    "story": {
      "type": "text",
      "fields": {
        "keyword": {
          "type": "keyword",
          "ignore_above": 256
        }
      }
    },
    "story number": {
      "type": "long"
    },
    "title": {
      "type": "text",
      "fields": {
        "keyword": {
          "type": "keyword",
          "ignore_above": 256
        }
      }
    },
    "topic": {
      "type": "text",
      "fields": {
        "keyword": {
          "type": "keyword",
          "ignore_above": 256
        }
      }
    }
      }
    }
      }
    }

Thanks in advance :grinning:

hello @vidhyadhara

ignore_above affects how data is indexed - https://www.elastic.co/guide/en/elasticsearch/reference/current/ignore-above.html

it can be changed by altering the mapping - https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html

Unfortunately this means it can't be changed on a per client basis.

Thanks,
Matt

1 Like

Hello @mattkime,

So there isn't any work to have a longer text in data table??

@vidhyadhara You can have longer text in a data table but it needs to be stored.

1 Like

What is the maximum length of data that can be displayed in a data table column? I did change the "ignore_above" value to 999999999 (which I found to be maximum allowed), still not able to display all the data. Below is the screen shot of my index mapping-

image

what or how I have to alter my index mapping to display the lengthy data.

@vidhyadhara

Are you looking at newly indexed data? ignore_above is applied at time of index.

1 Like

@mattkime
oh, I changed the mapping using kibana dev tools after the data is indexed. How to index with large value for ignore_above ?? I am indexing data from SQL database to Elasticsearch using python.

You need to reimport your data. Hopefully thats not too burdensome for you. If it is, you might import to a new index to verify you have the functionality you need.

1 Like

Hello @mattkime,

Beautiful... All I was missing was reimporting of the data. Thank you so much. :grinning:

1 Like

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