scalastic 0.8.3 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/scalastic/partition.rb +6 -0
- data/lib/scalastic/version.rb +1 -1
- data/regression/regression_tests/msearch.rb +34 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54238db7bdacb52cdf98f59bb95d4d06fad7467c
|
4
|
+
data.tar.gz: ff80c07e739be51b38cd5b81dc3b218b29baa124
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91d38321f125e69714fa1bbf24d645717b761204803df6b91f4c1595dbf1a54cf6a20319019ee093067919a1368bc698ddda4656bb585c7ea1b1d16cbd3459dc
|
7
|
+
data.tar.gz: 191cb49365704d140dc9e25e16c82dcc01bafd9901025f7fb2b84657b9abcb0ef7ea69ca380b06afdf357f8188f966034bb283385933fd6601aeeba6c2f3bdd7
|
data/lib/scalastic/partition.rb
CHANGED
@@ -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)
|
data/lib/scalastic/version.rb
CHANGED
@@ -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.
|
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-
|
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
|