-gem 'elasticsearch-model', '0.1.8'
-gem 'elasticsearch-rails', '0.1.8'
+gem 'elasticsearch-rails', '~> 5.0.2'
+gem 'elasticsearch-model', '~> 5.0.2'
bundle install
aws:
services:
elastic_search:
connection:
- host: 'http://localhost:9200'
+ host: 'https://search-nfhslearn-poc-cxxxxxxxxxxxx.us-east-1.es.amazonaws.com'
The string field datatype has been replaced by the text field for full text analyzed content, and the keyword field for not-analyzed exact string values.
- indexes :email, type: :string, index: :not_analyzed
+ indexes :email, type: :keyword
- indexes :first_name, type: :string, analyzer: :left_ngram
+ indexes :first_name, type: :text, analyzer: :left_ngram
- indexes :last_name, type: 'multi_field' do
- indexes :last_name, analyzer: :left_ngram
- indexes :raw, analyzer: :standard
- end
+ indexes :last_name, type: :text, analyzer: :left_ngram do
+ indexes :raw, type: :keyword
+ end
Refer https://www.elastic.co/guide/en/elasticsearch/reference/5.0/multi-fields.html https://stackoverflow.com/questions/40301061/elasticsearch-5-mapperparserexception-with-multi-field
Mapping is changed. payloads
is removed
{
"mappings": {
"song" : {
"properties" : {
"name" : { "type" : "string" },
"suggest" : { "type" : "completion",
"index_analyzer" : "simple",
"search_analyzer" : "simple",
"payloads" : true
}
}
}
}
}
to
{
"mappings": {
"song" : {
"properties" : {
"suggest" : {
"type" : "completion"
},
"title" : {
"type": "keyword"
}
}
}
}
}
https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-suggesters-completion.html
output and payload is removed changed from
PUT music/song/1?refresh=true
{
"name" : "Nevermind",
"suggest" : {
"input": [ "Nevermind", "Nirvana" ],
"output": "Nirvana - Nevermind",
"payload" : { "artistId" : 2321 },
"weight" : 34
}
}
to
PUT music/song/1?refresh
{
"suggest" : {
"input": [ "Nevermind", "Nirvana" ],
"weight" : 34
}
}
POST music/_suggest?pretty
{
"song-suggest" : {
"text" : "n",
"completion" : {
"field" : "suggest"
}
}
}
to
POST music/_suggest?pretty
{
"song-suggest" : {
"prefix" : "nir",
"completion" : {
"field" : "suggest"
}
}
}
< {"error":{"root_cause":[{"type":"parsing_exception","reason":"[nested] query does not support [filter]","line":1,"col":169}],"type":"parsing_exception","reason":"[nested] query does not support [filter]","line":1,"col":169},"status":400}
2018-01-18 17:52:52 +0530: [400] {"error":{"root_cause":[{"type":"parsing_exception","reason":"[nested] query does not support [filter]","line":1,"col":169}],"type":"parsing_exception","reason":"[nested] query does not support [filter]","line":1,"col":169},"status":400}
Elastic Search Error:
#<Elasticsearch::Transport::Transport::Errors::BadRequest: [400] {"error":{"root_cause":[{"type":"parsing_exception","reason":"[nested] query does not support [filter]","line":1,"col":169}],"type":"parsing_exception","reason":"[nested] query does not support [filter]","line":1,"col":169},"status":400}>
Elastic Search Error