lsolr 0.0.7 → 0.0.8
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 +13 -7
- 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: 3d4c5d52577c944f0791a16c8466af1d3039c66d
|
4
|
+
data.tar.gz: 15970c48d02ee7e663fb4817069a4989a3f0b7fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 866651def401510477a12cdd305c0a4a432f392a837c68b246332ffa392f197a8183baf938d377d3ad9ddd386cb823afb9b4ef8de7f01cc6838ed617521cfc7e
|
7
|
+
data.tar.gz: 2ab681e15a5e71e74e89583886e96deb9916cfbc5c11ad89f6eb5defa93f2da9120f533eadafa74b83421822ffd10e3288666461e2ef17751627d9c92411aa21
|
data/lib/lsolr.rb
CHANGED
@@ -176,7 +176,7 @@ class LSolr
|
|
176
176
|
# @return [LSolr] copied self instance
|
177
177
|
def wrap
|
178
178
|
this = dup
|
179
|
-
|
179
|
+
this.head.left_parentheses << PARENTHESIS_LEFT
|
180
180
|
this.right_parentheses << PARENTHESIS_RIGHT
|
181
181
|
this
|
182
182
|
end
|
@@ -354,6 +354,17 @@ class LSolr
|
|
354
354
|
link(another, OR)
|
355
355
|
end
|
356
356
|
|
357
|
+
# Returns a first term of query.
|
358
|
+
#
|
359
|
+
# @return [LSolr] a first term of query.
|
360
|
+
def head
|
361
|
+
if !prev.nil? && prev.present?
|
362
|
+
prev.head
|
363
|
+
else
|
364
|
+
self
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
357
368
|
private
|
358
369
|
|
359
370
|
def initialize_copy(obj)
|
@@ -376,17 +387,12 @@ class LSolr
|
|
376
387
|
return self if another.nil? || another.blank?
|
377
388
|
|
378
389
|
another = another.dup
|
379
|
-
head =
|
390
|
+
head = another.head
|
380
391
|
head.prev = dup
|
381
392
|
head.operator = operator
|
382
393
|
another
|
383
394
|
end
|
384
395
|
|
385
|
-
def take_head(element)
|
386
|
-
while !element.prev.nil? && element.prev.present? do element = element.prev end
|
387
|
-
element
|
388
|
-
end
|
389
|
-
|
390
396
|
def format_date(date)
|
391
397
|
msec_str = case date
|
392
398
|
when Date then date.strftime(FORMAT_MILLISECOND_FOR_DATE_TYPE).gsub(date.strftime(FORMAT_SECOND), '')
|