lsolr 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lsolr.rb +8 -1
- 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: 1803dd132f545657b9e07fca95b312cfea22abad
|
4
|
+
data.tar.gz: f6dd91a04b98d8d9878af741987c535c11189549
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8441813a97accd36e02b7b1e80d1a03dde9acab61d9378c5373828fd569f780ca4592d89b5b1a4297fa98bafeadccc5950fc6db4f6009be7796a3816f2ff14ce
|
7
|
+
data.tar.gz: 9fdf5792b7ce9de32d44f36bff486b86bdfa6b2e30dd2b1d9247d73e4069042952821baff7c0783fd6fb192dd1c7e4904f977f17b8eea445187b7cc24a09e1a1
|
data/lib/lsolr.rb
CHANGED
@@ -91,6 +91,13 @@ class LSolr
|
|
91
91
|
params.map { |f, v| build_query(f, v) }.reduce { |a, e| a.and(e) }
|
92
92
|
end
|
93
93
|
|
94
|
+
# Returns a empty term.
|
95
|
+
#
|
96
|
+
# @return [LSolr] a instance
|
97
|
+
def empty
|
98
|
+
new(:dummy)
|
99
|
+
end
|
100
|
+
|
94
101
|
private
|
95
102
|
|
96
103
|
def build_query(field, value) # rubocop:disable Metrics/CyclomaticComplexity
|
@@ -106,7 +113,7 @@ class LSolr
|
|
106
113
|
end
|
107
114
|
|
108
115
|
def build_array_query(field, values)
|
109
|
-
return LSolr.
|
116
|
+
return LSolr.empty if values.empty?
|
110
117
|
|
111
118
|
values.map { |v| build_query(field, v) }.reduce { |a, e| a.or(e) }.wrap
|
112
119
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lsolr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taishi Kasuga
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: LSolr is a query builder of Apache Solr standard Lucene type query for
|
14
14
|
Ruby.
|