我正在查看ElasticSearch 5.6上的单一类型索引的示例,以准备删除映射类型.具体来说,我正在运行ElasticSearch 页面中关于删除类型的第一个示例,在使用docker.elastic.co/elasticsearch/elasticsearch:5.6.5映像在Docker中本地运行的新集群上
运行我链接到的第一部分的第一个例子:
PUT localhost:9200/users
{
"settings": {
"index.mapping.single_type": true
},
"mappings": {
"_doc": {
"properties": {
"name": {
"type": "text"
},
"user_name": {
"type": "keyword"
},
"email": {
"type": "keyword"
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
{
"error": {
"root_cause": [
{
"type": "invalid_type_name_exception",
"reason": "mapping type name [_doc] can't start with '_'"
}
],
"type": "invalid_type_name_exception",
"reason": "mapping type name [_doc] can't start with '_'"
},
"status": 400
}
Run Code Online (Sandbox Code Playgroud)
我知道名称中带有前导下划线的字段通常被认为是为ES内部保留的; 但我假设这_doc将被视为一个从版本开始的特殊情况5.6 …
我有一个使用在Heroku上运行的Mongoid 3的rails应用程序.我刚刚更新它以使用Unicorn.当我尝试将其部署到Heroku时,我收到以下错误:
Running: rake assets:precompile
rake aborted!
undefined method `match' for nil:NilClass
/tmp/build_3nnbzpfmnjpns/vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.21/lib/mongoid/sessions/mongo_uri.rb:49:in `initialize'
Run Code Online (Sandbox Code Playgroud)
完整的堆栈跟踪可以在http://pastebin.com/8YcJHEmS找到
但是如果我从我的Gemfile中删除Unicorn,资产编译就会成功.查看Mongoid代码,我可以看到当mongoid.yml文件被解析时发生错误,但我无法弄清楚为什么Unicorn会导致失败.我的mongoid.yml文件看起来像这样:
production:
sessions:
default:
uri: <%= ENV['MONGOHQ_URL'] %>
options:
skip_version_check: true
safe: true
Run Code Online (Sandbox Code Playgroud)
我的Gemfile:
source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '3.2.11'
gem 'thin'
group :assets do
gem 'sass-rails', '~> 3.2'
gem 'coffee-rails', '~> 3.2'
gem 'uglifier', '>= 1.0.3'
gem "twitter-bootstrap-rails", '>=2.1.8'
gem "bootstrap_form"
end
gem "jquery-rails"
gem 'jquery-ui-rails', "3.0.1"
gem 'newrelic_rpm'
gem "httparty"
gem "resque"
gem "resque-loner"
gem "unicorn", "4.4.0"
gem "mongoid", "~> …Run Code Online (Sandbox Code Playgroud)