lsolr 0.2.5 → 1.0.0

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 +14 -13
  3. metadata +4 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f62e3d6943a8335c86176d97a925c07264012114
4
- data.tar.gz: 2697a1848081fe67280fd3359d19ccbb4ca1faec
2
+ SHA256:
3
+ metadata.gz: 72ca65e76238b682c58290896a7adf22ea8bc33d113c8dc1ae54297b48f5483a
4
+ data.tar.gz: 4552840e3133ffa77d69732fddf30923a806cb60c1b22dc12c9db02199e18735
5
5
  SHA512:
6
- metadata.gz: 63fb621dc8e66cfbebbb4ac88b3a90b612f74070583c0f04a96cac426e731f68fb8dea300bf454ef5fe47a6872fa77c03740335a59f1d920b908ca44a6bd2343
7
- data.tar.gz: 3890d9c7a11a34ce2b5939217efb2026da5fe559bde94948361c7b78730ae0ca18cb51a37a32dbbe529824b5656a436ef5536d86cb6c7c0b76472fa5d7d4994b
6
+ metadata.gz: dbc33e53020289eba40180b28e85df35ebfa64fa4d8e8ded93d0999eff5ce5001273267bf8c13eaa89a661d662e6d674e3d30223247bcc5bde1b102ef4750575
7
+ data.tar.gz: cd5ae5819e137b42b7a648344bc9c6656095d1a5374e4ba38624c32867ba779d3a9f683dee0f294af63f3126843db213c75512cdb23759687d1a348c135c6f47
@@ -98,7 +98,7 @@ class LSolr
98
98
  PARENTHESIS_RIGHT = ')'
99
99
 
100
100
  RESERVED_SYMBOLS = %w(- + & | ! ( ) { } [ ] ^ " ~ * ? : \\\\ /).freeze
101
- RESERVED_WORDS = /(AND|OR|NOT)/
101
+ RESERVED_WORDS = /(AND|OR|NOT)/.freeze
102
102
  REPLACEMENT_CHAR = ' '
103
103
 
104
104
  attr_accessor :prev, :operator, :left_parentheses, :right_parentheses, :expr_not
@@ -385,6 +385,7 @@ class LSolr
385
385
  # @raise [LSolr::ArgumentError] if specified distance is out of range
386
386
  def fuzzy_match(value, distance: 2.0)
387
387
  raise ArgumentError, "Out of #{RANGE_FUZZY_MATCH_DISTANCE}. `#{distance}` given." unless valid_fuzzy_match_distance?(distance)
388
+
388
389
  @value = "#{clean(value).split.join}#{PROXIMITY}#{distance}"
389
390
  self
390
391
  end
@@ -486,28 +487,28 @@ class LSolr
486
487
  !@raw.empty?
487
488
  end
488
489
 
489
- def present_string?(v)
490
- !v.nil? && (v.is_a?(String) || v.is_a?(Symbol)) && !v.empty?
490
+ def present_string?(val)
491
+ !val.nil? && (val.is_a?(String) || val.is_a?(Symbol)) && !val.empty?
491
492
  end
492
493
 
493
- def present_array?(v)
494
- !v.nil? && v.is_a?(Array) && !v.compact.empty? && v.map(&:to_s).map(&:empty?).none?
494
+ def present_array?(val)
495
+ !val.nil? && val.is_a?(Array) && !val.compact.empty? && val.map(&:to_s).map(&:empty?).none?
495
496
  end
496
497
 
497
- def present_query?(v)
498
- !v.nil? && v.present?
498
+ def present_query?(val)
499
+ !val.nil? && val.present?
499
500
  end
500
501
 
501
- def valid_boost_factor?(v)
502
- (v.is_a?(Float) || v.is_a?(Integer)) && v > 0
502
+ def valid_boost_factor?(val)
503
+ (val.is_a?(Float) || val.is_a?(Integer)) && val > 0
503
504
  end
504
505
 
505
- def valid_score?(v)
506
- v.is_a?(Float) || v.is_a?(Integer)
506
+ def valid_score?(val)
507
+ val.is_a?(Float) || val.is_a?(Integer)
507
508
  end
508
509
 
509
- def valid_fuzzy_match_distance?(v)
510
- (v.is_a?(Float) || v.is_a?(Integer)) && RANGE_FUZZY_MATCH_DISTANCE.member?(v)
510
+ def valid_fuzzy_match_distance?(val)
511
+ (val.is_a?(Float) || val.is_a?(Integer)) && RANGE_FUZZY_MATCH_DISTANCE.member?(val)
511
512
  end
512
513
 
513
514
  def clean(value, symbols: RESERVED_SYMBOLS)
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.5
4
+ version: 1.0.0
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-03-01 00:00:00.000000000 Z
11
+ date: 2019-03-21 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.
@@ -30,15 +30,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 2.2.2
33
+ version: 2.4.0
34
34
  required_rubygems_version: !ruby/object:Gem::Requirement
35
35
  requirements:
36
36
  - - ">="
37
37
  - !ruby/object:Gem::Version
38
38
  version: '0'
39
39
  requirements: []
40
- rubyforge_project:
41
- rubygems_version: 2.6.13
40
+ rubygems_version: 3.0.3
42
41
  signing_key:
43
42
  specification_version: 4
44
43
  summary: A query builder for Apache Solr in Ruby