redi_search 6.2.3 → 6.3.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/redi_search/search/term.rb +5 -0
- data/lib/redi_search/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d005b7e0b289004277bf5526a4270aa7dd707df16520ae0e2b9df577b12601c2
|
|
4
|
+
data.tar.gz: 9b3954997aa84e9e25037c6b332c00139d7d112dad9fffbbe32281f9da0fdfe1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dfcbe3552fef2dcb9abda2ad3e51c2bf35a2d2a16a631f249d1f1a89e5ed3aab5f0815387ab5a472f13db9c1d8a430f114840e81147e2b44160b1890be0f6c94
|
|
7
|
+
data.tar.gz: 3e2c1b66bb0053f42d886ab765468a213ab576b31d7d95a08f8bd216dcb8a933abbd76670207b2c9b366e988622a0aa1ece981901bb368916087c85a75b0726f
|
|
@@ -21,6 +21,7 @@ module RediSearch
|
|
|
21
21
|
def to_s
|
|
22
22
|
if term.is_a?(Range) then stringify_range
|
|
23
23
|
elsif field.is_a?(Schema::TagField) then stringify_tag
|
|
24
|
+
elsif term.is_a?(Array) then stringify_array
|
|
24
25
|
else
|
|
25
26
|
stringify_query
|
|
26
27
|
end
|
|
@@ -63,6 +64,10 @@ module RediSearch
|
|
|
63
64
|
"{ #{Array(term).join(' | ')} }"
|
|
64
65
|
end
|
|
65
66
|
|
|
67
|
+
def stringify_array
|
|
68
|
+
Array(term).map { |str| "`#{str}`" }.join(" | ")
|
|
69
|
+
end
|
|
70
|
+
|
|
66
71
|
def stringify_range
|
|
67
72
|
first, last = term.first, term.last
|
|
68
73
|
first = "-inf" if first == -Float::INFINITY
|
data/lib/redi_search/version.rb
CHANGED