scalastic 0.8.3 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee62608cd0f7a9e28cf377d8ccc9b46dca5bbb6e
4
- data.tar.gz: 9e57722efd8725a62eea09ca68f746e7173c9fe7
3
+ metadata.gz: 54238db7bdacb52cdf98f59bb95d4d06fad7467c
4
+ data.tar.gz: ff80c07e739be51b38cd5b81dc3b218b29baa124
5
5
  SHA512:
6
- metadata.gz: 82d1cc08d8f7e4349956f60acdef9b3541db0a3e3efbada1bff9609495e55a5fcd788d83970346bd811e955809a6e06e90ba344ee2f7ca1c5a4596274075e63e
7
- data.tar.gz: 1e348dcebe37380687a7522297831c6f0c622a4566e6ea1b34789a31a31f82bb9435da9eb62e1d893d612b466331eec5dba6dc21886573a8241c237093685d01
6
+ metadata.gz: 91d38321f125e69714fa1bbf24d645717b761204803df6b91f4c1595dbf1a54cf6a20319019ee093067919a1368bc698ddda4656bb585c7ea1b1d16cbd3459dc
7
+ data.tar.gz: 191cb49365704d140dc9e25e16c82dcc01bafd9901025f7fb2b84657b9abcb0ef7ea69ca380b06afdf357f8188f966034bb283385933fd6601aeeba6c2f3bdd7
@@ -41,6 +41,12 @@ module Scalastic
41
41
  es_client.search(args)
42
42
  end
43
43
 
44
+ def msearch(args)
45
+ endpoint = config.search_endpoint(id)
46
+
47
+ es_client.msearch(args.merge(index: endpoint))
48
+ end
49
+
44
50
  def get(args)
45
51
  args = args.merge(index: config.search_endpoint(id))
46
52
  es_client.get(args)
@@ -1,3 +1,3 @@
1
1
  module Scalastic
2
- VERSION = "0.8.3"
2
+ VERSION = "0.9.0"
3
3
  end
@@ -0,0 +1,34 @@
1
+ module RegressionTests
2
+ module Msearch
3
+ extend self
4
+
5
+ def cleanup
6
+ client = Elasticsearch::Client.new
7
+ client.indices.delete index: 'msearch' if client.indices.exists? index: 'msearch'
8
+ end
9
+
10
+ def run
11
+ client = Elasticsearch::Client.new
12
+ partitions = client.partitions
13
+
14
+ client.indices.create index: 'msearch'
15
+ partitions.prepare_index index: 'msearch'
16
+
17
+ partition = partitions.create(index: 'msearch', id: 1)
18
+ partition.index(id: '1:1', type: 'test', body: {title: 'Document 1:1'})
19
+ partition.index(id: '1:2', type: 'test', body: {title: 'Document 1:2'})
20
+
21
+ other_partition = partitions.create(index: 'msearch', id: 2)
22
+
23
+ other_partition.index(id: '2:1', type: 'test', body: {title: 'Document 2:1'})
24
+ other_partition.index(id: '2:2', type: 'test', body: {title: 'Document 2:2'})
25
+
26
+ sleep 1.5
27
+
28
+ results = partition.msearch(body: [{search: {query: {term: {_id: '1:1'}}}}, {search: {query: {term: {_id: '1:2'}}}}, {search: {query: {term: {_id: '1:3'}}}}])
29
+ found = results['responses'].map{|r| r['hits']['hits'].map{|h| h['_id']}}.flatten
30
+ expected = ['1:1', '1:2']
31
+ raise "Found #{found}, expected #{expected}" unless expected == found
32
+ end
33
+ end
34
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scalastic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aliaksei Baturytski
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-25 00:00:00.000000000 Z
11
+ date: 2016-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -139,6 +139,7 @@ files:
139
139
  - regression/regression_tests/index_destinations.rb
140
140
  - regression/regression_tests/list_partitions.rb
141
141
  - regression/regression_tests/mget.rb
142
+ - regression/regression_tests/msearch.rb
142
143
  - regression/regression_tests/nested_selector.rb
143
144
  - regression/regression_tests/nested_selector_bulk.rb
144
145
  - regression/regression_tests/partition_operations.rb