Commit 5a6f0fb3 by Clinton Blackburn Committed by Robert Raposa

Add support for Elasticsearch 1.5.2

Elasticsearch 0.90.x is quite out-of-date, and this requirement is preventing us from sharing an ES cluster with newer IDAs.

ECOM-3261 and SOL-295
parent 23d1a1f9
......@@ -3,7 +3,7 @@ version: "2"
services:
elasticsearch:
image: edxops/elasticsearch:0.9.13
image: elasticsearch:1.5.2
container_name: "es.edx"
mongo:
image: mongo:3.0.14
......
......@@ -34,8 +34,8 @@ gem 'will_paginate_mongoid', "~>2.0"
gem 'rdiscount'
gem 'nokogiri', "~>1.6.8"
gem 'elasticsearch', '~> 0.4'
gem 'elasticsearch-model', '~> 0.1.8'
gem 'elasticsearch', '~> 1.1.2'
gem 'elasticsearch-model', '~> 0.1.9'
gem 'dalli'
......
......@@ -54,16 +54,16 @@ GEM
docile (1.1.5)
domain_name (0.5.24)
unf (>= 0.0.5, < 1.0.0)
elasticsearch (0.4.11)
elasticsearch-api (= 0.4.11)
elasticsearch-transport (= 0.4.11)
elasticsearch-api (0.4.11)
elasticsearch (1.1.2)
elasticsearch-api (= 1.1.2)
elasticsearch-transport (= 1.1.2)
elasticsearch-api (1.1.2)
multi_json
elasticsearch-model (0.1.8)
elasticsearch-model (0.1.9)
activesupport (> 3)
elasticsearch (> 0.4)
hashie
elasticsearch-transport (0.4.11)
elasticsearch-transport (1.1.2)
faraday
multi_json
enumerize (0.11.0)
......@@ -72,7 +72,7 @@ GEM
activesupport (>= 3.0.0)
faker (1.6.1)
i18n (~> 0.5)
faraday (0.9.2)
faraday (0.11.0)
multipart-post (>= 1.2, < 3)
guard (1.3.2)
listen (>= 0.4.2)
......@@ -80,7 +80,7 @@ GEM
guard-unicorn (0.0.7)
guard (>= 1.1)
hashdiff (0.2.3)
hashie (3.4.3)
hashie (3.4.6)
http-cookie (1.0.2)
domain_name (~> 0.5)
i18n (0.7.0)
......@@ -106,7 +106,7 @@ GEM
mongoid_magic_counter_cache (1.1.1)
mongoid
rake
multi_json (1.11.2)
multi_json (1.12.1)
multipart-post (2.0.0)
netrc (0.10.3)
newrelic_rpm (3.16.0.318)
......@@ -191,8 +191,8 @@ DEPENDENCIES
dalli
delayed_job
delayed_job_mongoid
elasticsearch (~> 0.4)
elasticsearch-model (~> 0.1.8)
elasticsearch (~> 1.1.2)
elasticsearch-model (~> 0.1.9)
enumerize
factory_girl (~> 4.0)
faker (~> 1.6)
......
......@@ -12,10 +12,12 @@ def get_thread_ids(context, group_ids, local_params, search_text)
unless group_ids.empty?
filters.push(
{
or: [
{:not => {:exists => {:field => :group_id}}},
{:terms => {:group_id => group_ids}}
]
bool: {
should: [
{:not => {:exists => {:field => :group_id}}},
{:terms => {:group_id => group_ids}}
]
}
}
)
end
......@@ -26,14 +28,18 @@ def get_thread_ids(context, group_ids, local_params, search_text)
{updated_at: :desc}
],
query: {
multi_match: {
query: search_text,
fields: [:title, :body],
operator: :AND
},
filtered: {
query: {
multi_match: {
query: search_text,
fields: [:title, :body],
operator: :AND
}
},
filter: {
and: filters
bool: {
must: filters
}
}
}
}
......
......@@ -175,7 +175,7 @@ module TaskHelpers
fail "Alias '#{alias_name}' does not exist."
end
actual_mapping = Elasticsearch::Model.client.indices.get_mapping(index: alias_name).values[0]
actual_mapping = Elasticsearch::Model.client.indices.get_mapping(index: alias_name).values[0]['mappings']
expected_mapping = {}
[CommentThread, Comment].each do |model|
expected_mapping.merge! model.mappings.to_hash
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment