Skip to content

Only storing one mapping #35

@clintongormley

Description

@clintongormley

Hiya

Something weird is going on with put_mapping, eg:

  • index /foo/one/ -d { "xxx": "text"}
  • mappings for index 'foo' shows the correct mapping for 'one'

  • index /foo/two -d {"yyy": "text"}
  • mappings for index 'foo' shows the mapping for 'one' but not 'two'

or

  • index /foo/one/ -d { "xxx": "text"}
  • mappings for index 'foo' shows the correct mapping for 'one'

  • put_mapping /foo/two -d { properties: {"yyy": { type: "string"}}}
  • mappings for index 'foo' shows the mapping for 'one' but not 'two'

or

  • put_mapping /foo/one -d { properties: {"xxx": { type: "string"}}}
  • mappings for index 'foo' shows the correct mapping for 'one'

  • put_mapping /foo/two -d { properties: {"yyy": { type: "string"}}}
  • mappings for index 'foo' shows the mapping for 'two' but not for 'one'

Example below:

curl -XPOST 'http://127.0.0.2:9200/foo/one'  -d '
{
   "xxx" : "text"
}
'
# {
#    "ok" : true,
#    "_index" : "foo",
#    "_id" : "340e1d15-3dfd-4a8e-95ec-1c29fb8e9182",
#    "_type" : "one"
# }

Server log:
-----------
    Index [foo]: Update mapping [one] (dynamic) with source [{
      "one" : {
        "type" : "object",
        "dynamic" : true,
        "enabled" : true,
        "pathType" : "full",
        "dateFormats" : [ "dateOptionalTime" ],
        "boostField" : {
          "name" : "_boost"
        },
        "properties" : {
          "xxx" : {
            "type" : "string",
            "indexName" : "xxx",
            "index" : "analyzed",
            "store" : "no",
            "termVector" : "no",
            "boost" : 1.0,
            "omitNorms" : false,
            "omitTermFreqAndPositions" : false
          }
        }
      }
    }]


Cluster-state: indices.foo.mappings.mapping.value:
--------------------------------------------------
    '{
      "one" : {
        "type" : "object",
        "dynamic" : true,
        "enabled" : true,
        "pathType" : "full",
        "dateFormats" : [ "dateOptionalTime" ],
        "boostField" : {
          "name" : "_boost"
        },
        "properties" : {
          "xxx" : {
            "type" : "string",
            "indexName" : "xxx",
            "index" : "analyzed",
            "store" : "no",
            "termVector" : "no",
            "boost" : 1.0,
            "omitNorms" : false,
            "omitTermFreqAndPositions" : false
          }
        }
      }
    }'

curl -XPOST 'http://127.0.0.2:9200/foo/two'  -d '
{
   "yyy" : "text"
}
'
# {
#    "ok" : true,
#    "_index" : "foo",
#    "_id" : "c57b2421-943e-4623-be80-8168211fca5d",
#    "_type" : "two"
# }

Server log:
-----------
    Update mapping [two] (dynamic) with source [{
      "two" : {
        "type" : "object",
        "dynamic" : true,
        "enabled" : true,
        "pathType" : "full",
        "dateFormats" : [ "dateOptionalTime" ],
        "boostField" : {
          "name" : "_boost"
        },
        "properties" : {
          "yyy" : {
            "type" : "string",
            "indexName" : "yyy",
            "index" : "analyzed",
            "store" : "no",
            "termVector" : "no",
            "boost" : 1.0,
            "omitNorms" : false,
            "omitTermFreqAndPositions" : false
          }
        }
      }
    }]

Cluster-state: indices.foo.mappings.mapping.value:
--------------------------------------------------
    '{
      "one" : {
        "type" : "object",
        "dynamic" : true,
        "enabled" : true,
        "pathType" : "full",
        "dateFormats" : [ "dateOptionalTime" ],
        "boostField" : {
          "name" : "_boost"
        },
        "properties" : {
          "xxx" : {
            "type" : "string",
            "indexName" : "xxx",
            "index" : "analyzed",
            "store" : "no",
            "termVector" : "no",
            "boost" : 1.0,
            "omitNorms" : false,
            "omitTermFreqAndPositions" : false
          }
        }
      }
    }'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions