elasticated 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/elasticated/query.rb +6 -0
- data/lib/version.rb +4 -1
- data/spec/query_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7387656ed02b23a0dd1926af85e5bc0f1d6e11fe
|
4
|
+
data.tar.gz: 238aa946faf6a8c8472df905e5239ce01b42dffe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28c779821945de5bfc766e516b85e7e691c9bc41eb2a8dcb48028fd7a695add6ccc63e20b33358ce68ae3470ddca97c26bfd6cd224fb4ebdca9471d309224c89
|
7
|
+
data.tar.gz: e19fbc522bb1e6d1f4227051a8a9f72232baede359213f5fd94375a561ba8cec5e9439d66e47b5368c25e7a6092fe105ae9d2a6a6bb367b175a9f4908655a40e
|
data/lib/elasticated/query.rb
CHANGED
data/lib/version.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
module Elasticated
|
2
|
-
VERSION = '2.
|
2
|
+
VERSION = '2.2.0'
|
3
3
|
end
|
4
4
|
|
5
5
|
# Changelog
|
6
6
|
|
7
|
+
# 2.2.0
|
8
|
+
# Se agrega la funcionalidad para especificar un orden aleatorio en las queries
|
9
|
+
|
7
10
|
# 2.1.1
|
8
11
|
# Ahora se tiene en cuenta si la query tiene o no aggregations al momento de llamar a Repository#execute_aggregated_search
|
9
12
|
|
data/spec/query_spec.rb
CHANGED
@@ -94,6 +94,15 @@ module Elasticated
|
|
94
94
|
expect(q.build).to eq expected_result
|
95
95
|
end
|
96
96
|
|
97
|
+
it "should build a 'match_all' query sorted randomly" do
|
98
|
+
q.sort_randomly
|
99
|
+
expected_result = {
|
100
|
+
query: { match_all: {} },
|
101
|
+
sort: [ { _script: { script: "Math.random()", type: "number" } } ]
|
102
|
+
}
|
103
|
+
expect(q.build).to eq expected_result
|
104
|
+
end
|
105
|
+
|
97
106
|
it "should build a 'match_all' query with max size" do
|
98
107
|
q.size 5
|
99
108
|
expected_result = {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticated
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pablo Fernandez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|