rom-elasticsearch 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -8
  3. data/README.md +7 -7
  4. data/lib/rom-elasticsearch.rb +2 -0
  5. data/lib/rom/elasticsearch.rb +3 -1
  6. data/lib/rom/elasticsearch/attribute.rb +2 -0
  7. data/lib/rom/elasticsearch/commands.rb +2 -0
  8. data/lib/rom/elasticsearch/dataset.rb +6 -0
  9. data/lib/rom/elasticsearch/errors.rb +2 -0
  10. data/lib/rom/elasticsearch/gateway.rb +2 -0
  11. data/lib/rom/elasticsearch/index_name.rb +2 -0
  12. data/lib/rom/elasticsearch/plugins/relation/query_dsl.rb +2 -0
  13. data/lib/rom/elasticsearch/query_methods.rb +2 -0
  14. data/lib/rom/elasticsearch/relation.rb +60 -0
  15. data/lib/rom/elasticsearch/relation/loaded.rb +2 -0
  16. data/lib/rom/elasticsearch/schema.rb +5 -1
  17. data/lib/rom/elasticsearch/scroll_methods.rb +40 -0
  18. data/lib/rom/elasticsearch/types.rb +7 -5
  19. data/lib/rom/elasticsearch/version.rb +3 -1
  20. metadata +18 -78
  21. data/.codeclimate.yml +0 -6
  22. data/.gitignore +0 -22
  23. data/.rspec +0 -3
  24. data/.travis.yml +0 -27
  25. data/.yardopts +0 -7
  26. data/CONTRIBUTING.md +0 -29
  27. data/Gemfile +0 -19
  28. data/Rakefile +0 -19
  29. data/docker-compose.yml +0 -7
  30. data/rom-elasticsearch.gemspec +0 -27
  31. data/spec/integration/rom/elasticsearch/relation/command_spec.rb +0 -47
  32. data/spec/integration/rom/elasticsearch/relation/multi_index_spec.rb +0 -60
  33. data/spec/integration/rom/elasticsearch/relation/schema_spec.rb +0 -25
  34. data/spec/shared/setup.rb +0 -16
  35. data/spec/shared/unit/user_fixtures.rb +0 -15
  36. data/spec/shared/unit/users.rb +0 -18
  37. data/spec/spec_helper.rb +0 -42
  38. data/spec/unit/rom/elasticsearch/dataset/body_spec.rb +0 -13
  39. data/spec/unit/rom/elasticsearch/dataset/delete_spec.rb +0 -17
  40. data/spec/unit/rom/elasticsearch/dataset/params_spec.rb +0 -13
  41. data/spec/unit/rom/elasticsearch/dataset/put_spec.rb +0 -14
  42. data/spec/unit/rom/elasticsearch/dataset/query_string_spec.rb +0 -12
  43. data/spec/unit/rom/elasticsearch/dataset/search_spec.rb +0 -20
  44. data/spec/unit/rom/elasticsearch/gateway_spec.rb +0 -10
  45. data/spec/unit/rom/elasticsearch/plugins/relation/query_dsl_spec.rb +0 -34
  46. data/spec/unit/rom/elasticsearch/relation/call_spec.rb +0 -22
  47. data/spec/unit/rom/elasticsearch/relation/create_index_spec.rb +0 -75
  48. data/spec/unit/rom/elasticsearch/relation/dataset_spec.rb +0 -51
  49. data/spec/unit/rom/elasticsearch/relation/delete_spec.rb +0 -32
  50. data/spec/unit/rom/elasticsearch/relation/get_spec.rb +0 -22
  51. data/spec/unit/rom/elasticsearch/relation/map_spec.rb +0 -18
  52. data/spec/unit/rom/elasticsearch/relation/order_spec.rb +0 -40
  53. data/spec/unit/rom/elasticsearch/relation/page_spec.rb +0 -20
  54. data/spec/unit/rom/elasticsearch/relation/pluck_spec.rb +0 -18
  55. data/spec/unit/rom/elasticsearch/relation/query_spec.rb +0 -18
  56. data/spec/unit/rom/elasticsearch/relation/query_string_spec.rb +0 -18
  57. data/spec/unit/rom/elasticsearch/relation/search_spec.rb +0 -18
  58. data/spec/unit/rom/elasticsearch/relation/to_a_spec.rb +0 -28
@@ -1,18 +0,0 @@
1
- require 'rom/elasticsearch/relation'
2
-
3
- RSpec.describe ROM::Elasticsearch::Relation, '#search' do
4
- subject(:relation) { relations[:users] }
5
-
6
- include_context 'users'
7
-
8
- before do
9
- relation.command(:create).(id: 1, name: 'Jane')
10
- relation.command(:create).(id: 2, name: 'John')
11
-
12
- relation.refresh
13
- end
14
-
15
- it 'returns data matching search options' do
16
- expect(relation.search(query: { match: { name: 'Jane' } }).one).to eql(id: 1, name: 'Jane')
17
- end
18
- end
@@ -1,28 +0,0 @@
1
- require 'rom/elasticsearch/relation'
2
-
3
- RSpec.describe ROM::Elasticsearch::Relation, '#to_a' do
4
- subject(:relation) { relations[:users] }
5
-
6
- include_context 'users'
7
-
8
- before do
9
- relation.command(:create).(id: 1, name: 'Jane')
10
- relation.command(:create).(id: 2, name: 'John')
11
-
12
- relation.refresh
13
- end
14
-
15
- it 'returns user tuples' do
16
- expect(relation).to match_array([{ id: 1, name: 'Jane' }, { id: 2, name: 'John' }])
17
- end
18
-
19
- it 'returns user structs' do
20
- jane, john = relation.with(auto_struct: true).to_a.sort_by(&:name)
21
-
22
- expect(jane.id).to be(1)
23
- expect(jane.name).to eql('Jane')
24
-
25
- expect(john.id).to be(2)
26
- expect(john.name).to eql('John')
27
- end
28
- end