Skip to content

[Doc] ignore_above default value is wrong. #27992

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AlJuan opened this issue Dec 26, 2017 · 4 comments
Closed

[Doc] ignore_above default value is wrong. #27992

AlJuan opened this issue Dec 26, 2017 · 4 comments
Assignees
Labels
>docs General docs changes :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v6.1.4 v6.3.0 v7.0.0-beta1

Comments

@AlJuan
Copy link

AlJuan commented Dec 26, 2017

Elasticsearch version (bin/elasticsearch --version): Version: 6.1.1, Build: bd92e7f/2017-12-17T20:23:25.338Z, JVM: 1.8.0_151

Plugins installed: []

JVM version (java -version): openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

OS version (uname -a if on a Unix-like system): Linux pmitn009906 4.4.0-41-generic #61-Ubuntu SMP Tue Sep 27 17:27:48 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior: When i create a new index, the keyword mapping ignore_above defaults to 256. The doc says the default is 2147483647.

Steps to reproduce:

Please include a minimal but complete recreation of the problem, including
(e.g.) index creation, mappings, settings, query etc. The easier you make for
us to reproduce it, the more likely that somebody will take the time to look at it.

  1. First create an index:
    curl -XPUT 'localhost:9200/test?pretty' -H 'Content-Type: application/json' -d' { "settings" : { "index" : { } } }'
  2. Then insert some value:
    curl -XPUT 'localhost:9200/test/testType/1?pretty' -H 'Content-Type: application/json' -d' { "user" : "kimchy", "post_date" : "2009-11-15T14:12:12", "message" : "trying out Elasticsearch" } '
  3. When I get the mapping info for that index (curl -XGET 'localhost:9200/test/_mapping/testType?pretty') it returns:
{
  "test" : {
    "mappings" : {
      "testType" : {
        "properties" : {
          "message" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "post_date" : {
            "type" : "date"
          },
          "user" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          }
        }
      }
    }
  }
}

In addition to this, there is a blog post by Adrien Grand saying that the default ignore_above value is 256.

@DaveCTurner
Copy link
Contributor

I think the change proposed in #27991 seemed like the right thing to do, and I'm not sure why it was closed. WDYT @jpountz?

@DaveCTurner DaveCTurner added the :Search Foundations/Mapping Index mappings, including merging and defining field types label Dec 26, 2017
@jpountz
Copy link
Contributor

jpountz commented Dec 26, 2017

I guess the confusion comes from the fact that there are multiple defaults:

  • ignore_above has a default value of 2^31-1 on keyword fields. If you create a keyword field without providing an explicit value for ignore_above, this is the value that will be taken into account.
  • The default dynamic mappings for strings set up a keyword field that has ignore_above: 256.

By the way, the reason why ignore_above is explicit on the GET _mapping call is because it doesn't have the default value. Otherwise it would have been omitted.

@AlJuan
Copy link
Author

AlJuan commented Dec 26, 2017

Like @jpountz said, I created an index:

curl -XPUT 'localhost:9200/test?pretty' -H 'Content-Type: application/json' -d'
{
  "mappings": {
    "testType": { 
      "properties": { 
        "someField":    { "type": "keyword"  }        
      }
    }
  }
}
'

Now the ignore_above field is not explicit on the GET _mapping. The values I inserted on the someField field are indexed, even if they are longer than 256.

Should I close this issue?

@jasontedor jasontedor added v6.1.3 and removed v6.1.2 labels Jan 16, 2018
@colings86 colings86 added v6.3.0 and removed v6.2.0 labels Jan 22, 2018
jpountz added a commit to jpountz/elasticsearch that referenced this issue Jan 25, 2018
@bleskes bleskes added v6.1.4 and removed v6.1.3 labels Jan 29, 2018
jpountz added a commit that referenced this issue Jan 31, 2018
jpountz added a commit that referenced this issue Jan 31, 2018
@jiangjunjian
Copy link

org.springframework.dao.InvalidDataAccessApiUsageException: Document contains at least one immense term in field="detailContent" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped. Please correct the analyzer to not produce such terms.

@javanna javanna added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>docs General docs changes :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v6.1.4 v6.3.0 v7.0.0-beta1
Projects
None yet
Development

No branches or pull requests

8 participants