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

Make merging mappings smarter #253

Closed
clintongormley opened this issue Jul 13, 2010 · 8 comments
Closed

Make merging mappings smarter #253

clintongormley opened this issue Jul 13, 2010 · 8 comments

Comments

@clintongormley
Copy link

Currently, if you put a mapping that is exactly the same as an existing mapping (with ignore_conflicts set to false) then ES throws an error.

Could this be changed to only throw an error if an actual conflict occurs? (eg if trying to change the type of an existing field)

@kimchy
Copy link
Member

kimchy commented Jul 14, 2010

Make merging mappings smarter, closed by 2344555.

@clintongormley
Copy link
Author

This works, but when there is a conflict, the error isn't very helpful:

curl -XPUT 'http://127.0.0.1:9200/es_test_1,es_test_2/test/_mapping'  -d '
{
   "properties" : {
      "num" : {
         "type" : "string"
      },
      "text" : {
         "type" : "integer"
      }
   }
}
'
# {
#    "error" : "nested: "
# }

@kimchy
Copy link
Member

kimchy commented Jul 15, 2010

I've tried to crete conflicts, and get proper exception message. Can you paste a full recreation for the fugly message?

@clintongormley
Copy link
Author

It is not that the error is fugly, it is that it is too short, doesn't explain what the issue is:

curl -XPUT 'http://127.0.0.1:9200/es_test_1/'  -d '
{}
'
# {
#    "ok" : true,
#    "acknowledged" : true
# }


curl -XPUT 'http://127.0.0.1:9200/es_test_1/test/_mapping'  -d '
{
   "properties" : {
      "num" : {
         "type" : "integer"
      },
      "text" : {
         "type" : "string"
      }
   }
}
'
# {
#    "ok" : true,
#    "acknowledged" : true
# }


curl -XPUT 'http://127.0.0.1:9200/es_test_1/test/_mapping'  -d '
{
   "properties" : {
      "num" : {
         "type" : "string"
      },
      "text" : {
         "type" : "integer"
      }
   }
}
'
# {
#    "error" : "nested: "
# }

Also, it appears that ignore_conflicts is now being ignored:

curl -XPUT 'http://127.0.0.1:9200/es_test_1/test/_mapping?ignore_conflicts=true'  -d '
{
   "properties" : {
      "num" : {
         "type" : "string"
      },
      "text" : {
         "type" : "integer"
      }
   }
}
'
# {
#    "error" : "nested: "
# }

@kimchy
Copy link
Member

kimchy commented Jul 15, 2010

ok ,just pushed a fix for this, can you check? ignore conflicts should work as well.

@clintongormley
Copy link
Author

Error message much better.

However, the version with ignore_conflicts is now giving me this error:

ElasticSearchException[org.elasticsearch.index.mapper.xcontent.XContentStringFieldMapper cannot be cast to org.elasticsearch.index.mapper.xcontent.XContentNumberFieldMapper]; nested: ClassCastException[org.elasticsearch.index.mapper.xcontent.XContentStringFieldMapper cannot be cast to org.elasticsearch.index.mapper.xcontent.XContentNumberFieldMapper];

@kimchy
Copy link
Member

kimchy commented Jul 15, 2010

ok, hope its fixed now, otherwise, I am testing something wrong, which I don't really undersand how...

@clintongormley
Copy link
Author

Splendid. Fixed++

ClaudioMFreitas pushed a commit to ClaudioMFreitas/elasticsearch-1 that referenced this issue Nov 12, 2019
mindw pushed a commit to mindw/elasticsearch that referenced this issue Sep 5, 2022
)

Live shared files - expiration + CDN

* add cdn and expiration if needed to live shared files

* Update lifecycle rules

* Merge branch 'master' of bitbucket.org:engageli/devops into dev/matan/live_shared_files-10032021

* Merge branch 'master' of bitbucket.org:engageli/devops into dev/matan/live_shared_files-10032021

* no need to add cdn. already applied per sandbox


Approved-by: fabien
costin pushed a commit that referenced this issue Dec 6, 2022
🤖 ESQL: Merge upstream
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
Projects
None yet
Development

No branches or pull requests

2 participants