lsolr 0.0.8 → 0.0.9
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 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e884aa57682f3715a2070c525fb222b2d903ecc8996a8d4f0339c650b5c67876
|
4
|
+
data.tar.gz: 014e5b4258a969035f2f2584fa12c3bd56b1b1ae0ff9197f2b3894f8ba7268ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 812e0344c84e1b4bb878551b45366c54c0cfbe8c44b11420cd6560af99d6763c926fe1fb5011c6f8d568dcddb218f69ee7eaa1a6e51a74be2c5135446f3cb429
|
7
|
+
data.tar.gz: 682545466a8173b25191498109b3496c676f315a6cf20b401e2fe8ed16f6b15b2ded3dde69d1beec20dd8f779ec257be6bfdc637469b1da2dc73a0097e61e03f
|
data/lib/lsolr.rb
CHANGED
@@ -79,7 +79,7 @@ class LSolr
|
|
79
79
|
RESERVED_WORDS = /(AND|OR|NOT)/
|
80
80
|
REPLACEMENT_CHAR = ' '
|
81
81
|
|
82
|
-
attr_accessor :prev, :operator, :left_parentheses, :right_parentheses
|
82
|
+
attr_accessor :prev, :operator, :left_parentheses, :right_parentheses, :expr_not
|
83
83
|
|
84
84
|
class << self
|
85
85
|
# Builds composite query and returns builder instance.
|
@@ -131,7 +131,7 @@ class LSolr
|
|
131
131
|
def initialize(field)
|
132
132
|
raise ArgumentError, 'Please specify a field name.' if field.nil? || field.empty?
|
133
133
|
|
134
|
-
@
|
134
|
+
@expr_not = ''
|
135
135
|
@field = field
|
136
136
|
@value = ''
|
137
137
|
@range_first = ''
|
@@ -144,11 +144,11 @@ class LSolr
|
|
144
144
|
# Returns Apache Solr standard lucene type query string.
|
145
145
|
#
|
146
146
|
# @return [String] a stringified query
|
147
|
-
def to_s
|
147
|
+
def to_s # rubocop:disable Metrics/AbcSize
|
148
148
|
@value = "#{@range_first} #{TO} #{@range_last}" if range_search?
|
149
149
|
raise IncompleteQueryError, 'Please specify a search value.' if blank?
|
150
150
|
|
151
|
-
expr = "#{left_parentheses.join}#{@
|
151
|
+
expr = "#{expr_not}#{left_parentheses.join}#{@field}:#{@value}#{right_parentheses.join}"
|
152
152
|
expr = "#{prev} #{operator} #{expr}" if !prev.nil? && prev.present?
|
153
153
|
"#{expr}#{@boost}"
|
154
154
|
end
|
@@ -187,8 +187,9 @@ class LSolr
|
|
187
187
|
#
|
188
188
|
# @return [LSolr] self instance
|
189
189
|
def not
|
190
|
-
|
191
|
-
|
190
|
+
this = dup
|
191
|
+
this.head.expr_not = "#{NOT} "
|
192
|
+
this
|
192
193
|
end
|
193
194
|
|
194
195
|
# Boosts a query expression.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lsolr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taishi Kasuga
|
@@ -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.7.3
|
42
42
|
signing_key:
|
43
43
|
specification_version: 4
|
44
44
|
summary: A query builder of Apache Solr for Ruby
|