3
votes

can anyone please help on one of the doubts regarding the explaination if ignore above that is there in the elastic document its mentioned that Strings longer than the ignore_above setting will not be indexed or stored. For arrays of strings, ignore_above will be applied for each array element separately and string elements longer than ignore_above will not be indexed or stored.

does this means that if i add data longer then the length then it won't allow to post data in ES

https://www.elastic.co/guide/en/elasticsearch/reference/current/ignore-above.html#ignore-above

Here is what i have tried

my mapping for index testData(i.e index i created) is as follows

using PUT mapping api i added the following mapping

{
"testdata": {
    "mappings": {
        "testdata": {
            "properties": {
                "email": {
                    "type": "text",
                    "fields": {
                        "keyword": {
                            "type": "keyword",
                            "ignore_above": 256
                        }
                    }
                }
            }
        }
    }
}
}

i added data which has length i.e around 150kb(by length around 145149) it allowed to add the data in the email field , i am also able to search data using post search endpoint, should it allow do to that or am i getting this concept wrong.

2

2 Answers

2
votes

Your setting ignore_above: 256 means if the string length is greater than 256 characters then the document is indexed but that field will not be indexed. If the string length is < 256 characters then the document along with the field will be indexed. Example - String length for text "stackoverflow" is 13 characters. Hope this clarifies.

As per your mapping, the ignore_above setting is applied to the email.keyword field.

1
votes

I solve my problem today ,I can't get agg terms value by xx.keyword. My value length is 315.

if string longer than the ignore_above value , xx.keyword will not work for search. But the value can be saved , you can search the doc by other fields.