lsolr 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lsolr.rb +8 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25bce1dc030cbb341e8d705adc503e0e1e17c8f3
4
- data.tar.gz: 5fb367c38c9672ff05890c43b0b91fa4bec7c094
3
+ metadata.gz: 1803dd132f545657b9e07fca95b312cfea22abad
4
+ data.tar.gz: f6dd91a04b98d8d9878af741987c535c11189549
5
5
  SHA512:
6
- metadata.gz: 94ac718ad72a7a49636fec7ecb1a47723e56f285d3d628c2db02beb5db2c8a9ba4f9244efc19c2467460d9f102dbf7b855857e62c4e91e995a57511ca7f3bebb
7
- data.tar.gz: 943982244f025a615550a34a9bf22b107835f97e7250570b2400086460c44833d1a6ef8bac54fb6b4d770a3f789703373442f6227d51b0452b08cbc269d8855f
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.new(:dummy) if values.empty?
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.2
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-17 00:00:00.000000000 Z
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.