lsolr 0.0.0 → 0.0.1
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 +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6720d54fb177afa0758873f10fd7c21aadcea716
|
4
|
+
data.tar.gz: 872adfaf99faa64e7e98a344525b7ab6a53742f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 312018c284bc152e68c770ffd35ea2d952c5ff6505fc1f9bfc5d32297c604bd48a9dd35598eee05ee6e5aa3838c9cdc693c01aec2d00cebefa721a1da576d466
|
7
|
+
data.tar.gz: a4056e9a1f33afd62a4bde0d242f404ab041cb9d67d7495c36a9a634365315eb79645208e5c87037ab05e4ebf48e47de75409ee4e471a26fd247717755d16c67
|
data/lib/lsolr.rb
CHANGED
@@ -56,7 +56,7 @@ class LSolr
|
|
56
56
|
raise 'Please specify a search condition.' if blank?
|
57
57
|
|
58
58
|
expr = "#{left_parentheses.join}#{@not}#{@field}:#{@value}#{right_parentheses.join}"
|
59
|
-
expr = "#{prev} #{operator} #{expr}" if prev
|
59
|
+
expr = "#{prev} #{operator} #{expr}" if !prev.nil? && prev.present?
|
60
60
|
"#{expr}#{@boost}"
|
61
61
|
end
|
62
62
|
|
@@ -133,7 +133,7 @@ class LSolr
|
|
133
133
|
# @param distance [Float] proximity distance
|
134
134
|
# @return [LSolr] self instance
|
135
135
|
def fuzzy_match(value, distance: 0.0)
|
136
|
-
raise RangeError, "Out of #{FUZZY_MATCH_DISTANCE_RANGE}. #{distance} given." unless
|
136
|
+
raise RangeError, "Out of #{FUZZY_MATCH_DISTANCE_RANGE}. #{distance} given." unless FUZZY_MATCH_DISTANCE_RANGE.member?(distance)
|
137
137
|
@value = "#{clean(value)}#{PROXIMITY}#{distance}"
|
138
138
|
self
|
139
139
|
end
|
@@ -181,7 +181,7 @@ class LSolr
|
|
181
181
|
private
|
182
182
|
|
183
183
|
def initialize_copy(obj)
|
184
|
-
obj.prev = obj.prev.dup if obj.prev
|
184
|
+
obj.prev = obj.prev.dup if !obj.prev.nil? && obj.prev.present?
|
185
185
|
obj.left_parentheses = obj.left_parentheses.dup
|
186
186
|
obj.right_parentheses = obj.right_parentheses.dup
|
187
187
|
end
|
@@ -207,7 +207,7 @@ class LSolr
|
|
207
207
|
end
|
208
208
|
|
209
209
|
def take_head(element)
|
210
|
-
while element.prev
|
210
|
+
while !element.prev.nil? && element.prev.present? do element = element.prev end
|
211
211
|
element
|
212
212
|
end
|
213
213
|
end
|