Skip to content
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

Analyzers starting with _ are silently ignored #9596

Closed
brwe opened this issue Feb 6, 2015 · 1 comment · Fixed by #11303
Closed

Analyzers starting with _ are silently ignored #9596

brwe opened this issue Feb 6, 2015 · 1 comment · Fixed by #11303
Assignees
Labels
>bug help wanted adoptme :Search/Analysis How text is split into tokens v2.0.0-beta1

Comments

@brwe
Copy link
Contributor

brwe commented Feb 6, 2015

When an analyzer is defined that has a name starting with _ then this analyzer is silently dropped from the mapping once the mapping source is propagated through the cluster (https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/index/mapper/core/AbstractFieldMapper.java#L795). The local document mapper and mapping in the cluster state are then out of sync on some nodes and documents might be analyzed with the default analyzer on some or the analyzer that was defined by the user on others. After restarting the nodes, the analyzer setting is completely lost. Example below.

When an analyzer is configured in the index settings, there should be a check to make sure the name does not start with an _.

See also: #3544 (comment)

Example:

PUT test
{
  "settings": {
    "analysis": {
      "analyzer": {
        "_some_name": {
          "tokenizer":"keyword"
        }
      }
    }
  }
}

PUT test/_mapping/page
{
  "page": {
    "properties": {
      "text": {
        "type": "string",
        "analyzer": "_some_name"
      }
    }
  }
}

GET test/_mapping

results in


{
   "test": {
      "mappings": {
         "page": {
            "properties": {
               "text": {
                  "type": "string"
               }
            }
         }
      }
   }
}
@rjernst
Copy link
Member

rjernst commented Feb 6, 2015

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug help wanted adoptme :Search/Analysis How text is split into tokens v2.0.0-beta1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants