lsolr 0.1.6 → 0.1.7

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 +5 -5
  2. data/lib/lsolr.rb +8 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5209c6df0afed03c107799afd32286c6f1e2c5fb
4
- data.tar.gz: 2f621984e15a5472db655670cc615c263b39b8db
2
+ SHA256:
3
+ metadata.gz: 4515726ee247a275e8909025ed9baf65125820168fa8bfdcf0b304958123f006
4
+ data.tar.gz: 6e565192d0b2a49ce376a2a7b17dbd11d696cdd2bb47d8846171ae7c5f9bfebf
5
5
  SHA512:
6
- metadata.gz: 30a21016fb99353993723f424d3a0d875d86b042361fa3c39a0154f961e0d0806c96047e92c92bc6775f7b4fcd8a04150b8368447bc9b58c126840e28cf3b2ff
7
- data.tar.gz: 85f2ab04086bc0f6d965348188b545448e2c86ed0ea52d731de37fc95adbdeb7a65fc76c155a044e20bad7fab47f2138d734aeecd6c53bd995b13dae4430b198
6
+ metadata.gz: d71accb2420552e9b85114211e08251d4ad499ce722b2bfca63378b4a2b49078342514d4da304a965dfa4f6cfb92ebfd3a2594c32c5d951375ab60a4fea0ea14
7
+ data.tar.gz: 27ffeadda84fb03ff6ff23562982682044322ce789911c2effd732e62b856d876fc84d4988340f821af5c1031c24c9188b96dc83a44fed9e54507e9367e0166b
@@ -149,13 +149,10 @@ class LSolr
149
149
  # Returns Apache Solr standard lucene type query string.
150
150
  #
151
151
  # @return [String] a stringified query
152
- def to_s # rubocop:disable Metrics/AbcSize
152
+ def to_s
153
153
  raise IncompleteQueryError, 'Please specify search field and value.' if blank?
154
154
 
155
- expr = build_term_expr
156
- expr = "#{expr_not}#{left_parentheses.join}#{expr}#{right_parentheses.join}"
157
- expr = "#{prev} #{operator} #{expr}" if !prev.nil? && prev.present?
158
- "#{expr}#{@boost}"
155
+ decorate_term_expr_if_needed(build_term_expr)
159
156
  end
160
157
 
161
158
  alias to_str to_s
@@ -444,4 +441,10 @@ class LSolr
444
441
  "#{@field}:#{@value}"
445
442
  end
446
443
  end
444
+
445
+ def decorate_term_expr_if_needed(expr)
446
+ expr = "#{expr_not}#{left_parentheses.join}#{expr}#{right_parentheses.join}"
447
+ expr = "#{prev} #{operator} #{expr}" if !prev.nil? && prev.present?
448
+ "#{expr}#{@boost}"
449
+ end
447
450
  end
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.1.6
4
+ version: 0.1.7
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.6.14
41
+ rubygems_version: 2.7.4
42
42
  signing_key:
43
43
  specification_version: 4
44
44
  summary: A query builder of Apache Solr for Ruby