Skip to content

Only storing one mapping #35

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
clintongormley opened this issue Feb 22, 2010 · 5 comments
Closed

Only storing one mapping #35

clintongormley opened this issue Feb 22, 2010 · 5 comments

Comments

@clintongormley
Copy link
Contributor

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
          }
        }
      }
    }'
@clintongormley
Copy link
Contributor Author

Btw, it looks like the mapping is still enforced, you're just not merging the JSON metadata correctly

@kimchy
Copy link
Member

kimchy commented Feb 22, 2010

I am not sure I understand. I indexed into type one, and indexed into type two, and then ran the _cluster/state and I do see the two mappings.

By the way, the mappings returned were wrong in terms of JSON response, since I returned the same object name (mapping) for each one. I fixed it. Maybe that was the reason?

@clintongormley
Copy link
Contributor Author

yep, the old "json properties SHOULD..." issue - your commit fixed it.

thanks

@kimchy
Copy link
Member

kimchy commented Feb 22, 2010

No problem. I thought I went over all the places and fixed them, guess I missed this one.

@kimchy
Copy link
Member

kimchy commented Feb 22, 2010

cool, I will close the issue then.

nkvoll added a commit that referenced this issue Jun 5, 2015
Breaking changes in to EsExecutors was introduced in elasticsearch 0.90.4
Closes #35.
dadoonet added a commit that referenced this issue Jun 5, 2015
dadoonet added a commit that referenced this issue Jun 5, 2015
`Strings.startsWithIgnoreCase()` has been removed in elasticsearch 1.4 ans master. See #7428

Closes #35.
dadoonet added a commit that referenced this issue Jun 5, 2015
Introduced in #7336 (elasticsearch 1.4 and 2.0), we need to change GceDiscovery constructor.

Closes #35.
johtani added a commit that referenced this issue Jun 5, 2015
johtani added a commit that referenced this issue Jun 5, 2015
dadoonet added a commit that referenced this issue Jun 9, 2015
ywelsch added a commit to ywelsch/elasticsearch that referenced this issue May 24, 2018
Adds node joining based on a simplified MasterService abstraction.
ClaudioMFreitas pushed a commit to ClaudioMFreitas/elasticsearch-1 that referenced this issue Nov 12, 2019
henningandersen pushed a commit to henningandersen/elasticsearch that referenced this issue Jun 4, 2020
With this commit we measure raw event size and add it is a new field in
the generated documents.

Relates elastic#35
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this issue Oct 2, 2023
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this issue Oct 2, 2023
This issue was closed.
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

No branches or pull requests

2 participants