diff --git a/.travis.yml b/.travis.yml index 74c23ef..8c598d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: ruby before_install: - gem update bundler - - curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.1.1.deb && sudo dpkg -i --force-confnew elasticsearch-5.1.1.deb && sudo service elasticsearch restart + - curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.6.1.deb && sudo dpkg -i --force-confnew elasticsearch-6.6.1.deb && sudo service elasticsearch restart rvm: - 2.2.2 - 2.2.3 diff --git a/CHANGELOG b/CHANGELOG index be50c88..2ab0d6f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +v0.13.0 + - update test to run against 6.6.1 v0.12.0 - warn when configuring a index with subclasses if using ES version that does support them - raise exception when creating or adding document to an index configured with subclasses if using diff --git a/README.md b/README.md index ccb45ff..013d0e1 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Or install it yourself as: ### Version Support This gem has [elasticsearch-ruby](https://github.com/elastic/elasticsearch-ruby) as a dependency. In order to use different versions of elasticsearch you will need to match your version of elasticsearch-ruby to the version of elasticsearch you want to use ([see here](https://github.com/elastic/elasticsearch-ruby#compatibility). Elasticity should work across all versions of elastisearch-ruby, although they have not all been tested so there are likely edge cases. -Currently tests are run on travis ci against elasticsearch 5.1.1 with elasticsearch-ruby 5.0.3. +Currently tests are run on travis ci against elasticsearch 6.6.1 with elasticsearch-ruby 5.0.3. ### Configuration diff --git a/es-elasticity-0.12.0.pre.rc1.gem b/es-elasticity-0.12.0.pre.rc1.gem deleted file mode 100644 index ceb2c18..0000000 Binary files a/es-elasticity-0.12.0.pre.rc1.gem and /dev/null differ diff --git a/lib/elasticity/version.rb b/lib/elasticity/version.rb index 4bb86e3..45117ad 100644 --- a/lib/elasticity/version.rb +++ b/lib/elasticity/version.rb @@ -1,3 +1,3 @@ module Elasticity - VERSION = "0.12.0" + VERSION = "0.13.0" end diff --git a/spec/functional/persistence_spec.rb b/spec/functional/persistence_spec.rb index 6721ddf..6490859 100644 --- a/spec/functional/persistence_spec.rb +++ b/spec/functional/persistence_spec.rb @@ -71,88 +71,6 @@ def to_document end end - describe 'multi mapping index' do - class Animal < Elasticity::Document - configure do |c| - c.index_base_name = "cats_and_dogs" - c.strategy = Elasticity::Strategies::SingleIndex - c.subclasses = { cat: "Cat", dog: "Dog" } - end - end - - class Cat < Animal - configure do |c| - c.index_base_name = "cats_and_dogs" - c.strategy = Elasticity::Strategies::SingleIndex - c.document_type = "cat" - - c.mapping = { "properties" => { - name: { type: "text", index: true }, - age: { type: "integer" } - } } - end - - attr_accessor :name, :age - - def to_document - { name: name, age: age } - end - end - - class Dog < Animal - configure do |c| - c.index_base_name = "cats_and_dogs" - c.strategy = Elasticity::Strategies::SingleIndex - c.document_type = "dog" - c.mapping = { "properties" => { - name: { type: "text", index: true }, - age: { type: "integer" }, - hungry: { type: "boolean" } - } } - end - attr_accessor :name, :age, :hungry - - def to_document - { name: name, age: age, hungry: hungry } - end - end - - before do - Animal.recreate_index - @elastic_search_client.cluster.health wait_for_status: 'yellow' - end - - it "successful index, update, search, count and deletes" do - cat = Cat.new(name: "felix", age: 10) - dog = Dog.new(name: "fido", age: 4, hungry: true) - - cat.update - dog.update - - Animal.flush_index - - results = Animal.search({}) - expect(results.total).to eq 2 - expect(results.map(&:class)).to include(Cat, Dog) - - results = Cat.search({}) - expect(results.total).to eq 1 - expect(results.first.class).to eq Cat - - results = Dog.search({}) - expect(results.total).to eq 1 - expect(results.first.class).to eq Dog - - cat.delete - Animal.flush_index - - results = Animal.search({}) - expect(results.total).to eq 1 - expect(results.map(&:class)).to include(Dog) - expect(results.scan_documents.count).to eq(1) - end - end - describe "alias index strategy" do subject do Class.new(Elasticity::Document) do diff --git a/spec/units/strategies/single_index_spec.rb b/spec/units/strategies/single_index_spec.rb index 860602c..3c0d822 100644 --- a/spec/units/strategies/single_index_spec.rb +++ b/spec/units/strategies/single_index_spec.rb @@ -66,7 +66,7 @@ subject.flush expect { subject.get_document("document", 1) }.to raise_error(Elasticsearch::Transport::Transport::Errors::NotFound) - expect(subject.get_document("document", 2)).to eq({"_index"=>"test_index_name", "_type"=>"document", "_id"=>"2", "_version"=>1, "found"=>true, "_source"=>{"name"=>"bar"}}) + expect(subject.get_document("document", 2)).to include({"_index"=>"test_index_name", "_type"=>"document", "_id"=>"2", "_version"=>1, "found"=>true, "_source"=>{"name"=>"bar"}}) end it "allows deleting by query" do