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

"include_in_all": false not working for nested multi-field mappings #5364

Closed
asanderson opened this issue Mar 7, 2014 · 2 comments
Closed
Assignees

Comments

@asanderson
Copy link

I'm running Elasticsearch 1.0.1 using the following $ES_HOME/config/default-mapping.json:

{
  "_default_": {
    "properties": {
      "foo": {
        "type": "nested",
        "include_in_all": false,
        "properties": {
          "bar": {
            "type": "string",
            "index": "not_analyzed",
            "include_in_all": false,
            "fields": {
              "lower": {
                "analyzer": "standard",
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}

When I post the following, the include_in_all does not seem to be recognized at any level:

 {
   "foo": {
     "bar": "Elasticsearch rules!"
   }
 }

The resulting metadata is the following:

{
    state: open
    settings: {
        index: {
            uuid: S2hmo2d3SGWFP51PXs6XbA
            number_of_replicas: 0
            number_of_shards: 1
            version: {
                created: 1000199
            }
        }
    }
    mappings: {
        foobar: {
            properties: {
               foo: {
                   include_in_all: false
                    properties: {
                        bar: {
                            include_in_all: false
                            index: not_analyzed
                            type: string
                            fields: {
                                lower: {
                                    analyzer: standard
                                    type: string
                                }
                            }
                        }
                    }
                    type: nested
                }
            }
        }
    }
    aliases: [ ]
}

I verified that _all does include the "elasticsearch rules" via the following aggregation search:

{
  "aggs": {
    "foobar": {
      "terms": {
        "field": "_all"
      }
    }
  },
  "size": 0
}

The aggs search result is the following:

{
    took: 36
    timed_out: false
    _shards: {
        total: 1
        successful: 1
        failed: 0
    }
    hits: {
        total: 1
        max_score: 0
        hits: [ ]
    }
    aggregations: {
        foo: {
            buckets: [
                {
                    key: elasticsearch
                    doc_count: 1
                }
                {
                    key: rule
                    doc_count: 1
                }
            ]
        }
    }
}

So, _all should be empty, but it is not.

@clintongormley
Copy link

Confirmed that this is a problem. I also tried setting include_in_root and include_in_parent to false, but the values still end up in _all.

@martijnvg
Copy link
Member

This has been fixed via PR #5522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants