lsolr 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/lsolr.rb +7 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f62e3d6943a8335c86176d97a925c07264012114
|
4
|
+
data.tar.gz: 2697a1848081fe67280fd3359d19ccbb4ca1faec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63fb621dc8e66cfbebbb4ac88b3a90b612f74070583c0f04a96cac426e731f68fb8dea300bf454ef5fe47a6872fa77c03740335a59f1d920b908ca44a6bd2343
|
7
|
+
data.tar.gz: 3890d9c7a11a34ce2b5939217efb2026da5fe559bde94948361c7b78730ae0ca18cb51a37a32dbbe529824b5656a436ef5536d86cb6c7c0b76472fa5d7d4994b
|
data/lib/lsolr.rb
CHANGED
@@ -299,7 +299,13 @@ class LSolr
|
|
299
299
|
# @param value [String, Integer, true, false] a search word or a filter value
|
300
300
|
#
|
301
301
|
# @return [LSolr] self instance
|
302
|
+
#
|
303
|
+
# @raise [LSolr::ArgumentError] if specified value is empty
|
302
304
|
def match(value)
|
305
|
+
raise ArgumentError, "`#{value}` given. It must be a not empty value." unless present_string?(value.to_s)
|
306
|
+
return match_in(value) if value.is_a?(Array)
|
307
|
+
return date_time_match(value) if value.is_a?(Date) || value.is_a?(Time)
|
308
|
+
|
303
309
|
values = clean(value).split
|
304
310
|
|
305
311
|
if values.size > 1
|
@@ -319,6 +325,7 @@ class LSolr
|
|
319
325
|
# @raise [LSolr::ArgumentError] if specified value is a empty array or not array
|
320
326
|
def match_in(values)
|
321
327
|
raise ArgumentError, "`#{values}` given. It must be a not empty array." unless present_array?(values)
|
328
|
+
return match(values.first) if values.size == 1
|
322
329
|
|
323
330
|
values = values.map { |v| clean(v) }
|
324
331
|
@value = "(#{values.join(DELIMITER_SPACE)})"
|
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.2.
|
4
|
+
version: 0.2.5
|
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-
|
11
|
+
date: 2018-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: LSolr is a query builder for Apache Solr in Ruby. It supports only the
|
14
14
|
standard query.
|
@@ -38,7 +38,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
38
38
|
version: '0'
|
39
39
|
requirements: []
|
40
40
|
rubyforge_project:
|
41
|
-
rubygems_version: 2.
|
41
|
+
rubygems_version: 2.6.13
|
42
42
|
signing_key:
|
43
43
|
specification_version: 4
|
44
44
|
summary: A query builder for Apache Solr in Ruby
|