smart_search 0.0.79 → 0.0.81

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62dbf1c59fdc7b6437961e88670fc3c88367d376
4
- data.tar.gz: 4bf90b56b6d8354d9b9db7422973b48a69a29904
3
+ metadata.gz: 4a9d6e89ffe0e662d4d946c4ccc502e66cf9c6aa
4
+ data.tar.gz: c3e41c85265d845239081bb62307c801715b75cd
5
5
  SHA512:
6
- metadata.gz: 76240f88dbaccbf77a5c3ad4bec12f57c1657ccb67d4488d7abea26ba15b795387a05f616383c1833520866d137d033330e18c94250d9d1613c6614d5c670de1
7
- data.tar.gz: 8750f3440e155d09a0cee75708611f8a3c880ca8567d1f70aac188d06dc81b6a601ffddb5c1134edc3a8e76cc15282b2be2430ee0a27157945372ad928e36087
6
+ metadata.gz: '00598b98be8d13857268ee6cc5cfb294fc86b18a8068a709dc65a41f839cb62c5a4b61bfa7d276d8339b85e39631a149416e9650f4742e575194ded00ddc3f90'
7
+ data.tar.gz: b236f7fa679dd09618d83630b4271657302bbbe730ef625e8b6696e0b4fdebb5e82415f22e44960ad596a95b442ea46fb0d96d3a59a3cf62c2bc370e4f9ca474
data/lib/smart_search.rb CHANGED
@@ -230,7 +230,7 @@ module SmartSearch
230
230
  # Remove search data for the instance from the index
231
231
  def clear_search_tags
232
232
  if !self.id.nil?
233
- SmartSearchTag.connection.execute("DELETE from #{SmartSearchTag.table_name} where `table_name` = '#{self.class.table_name}' and entry_id = #{self.id}")
233
+ SmartSearchTag.connection.execute("DELETE from #{SmartSearchTag.table_name} where `table_name` = '#{self.class.table_name}' and entry_id = #{self.id}") rescue nil
234
234
  end
235
235
  end
236
236
 
@@ -4,7 +4,7 @@ namespace :smart_search do
4
4
  require File.expand_path("../../smart_similarity", __FILE__)
5
5
  SmartSimilarity.load_from_query_history
6
6
  end
7
-
7
+
8
8
  desc "Load similarity data from file - Use FILE=path/to/file to specify file"
9
9
  task :similarity_from_file => :environment do
10
10
  require File.expand_path("../../smart_similarity", __FILE__)
@@ -12,47 +12,47 @@ namespace :smart_search do
12
12
  raise ArgumentError, "No file specified. "
13
13
  elsif !File.exist?(ENV['FILE_PATH'])
14
14
  raise ArgumentError, "File not found "
15
- else
15
+ else
16
16
  SmartSimilarity.load_file(ENV['FILE_PATH'])
17
- end
17
+ end
18
18
  end
19
-
19
+
20
20
  desc "Load similarity data from url - Use URL=http://.../ to specify url - Requires 'curl'"
21
21
  task :similarity_from_url => :environment do
22
22
  require File.expand_path("../../smart_similarity", __FILE__)
23
23
  if ENV['URL'].nil?
24
24
  raise ArgumentError, "No URL specified. "
25
- else
25
+ else
26
26
  SmartSimilarity.load_url(ENV['URL'])
27
- end
27
+ end
28
28
  end
29
-
30
-
31
-
29
+
30
+
31
+
32
32
  desc "load ignore words list"
33
33
  task :load_ignore_words => :environment do
34
34
  require File.expand_path("../../smart_search_ignore_word", __FILE__)
35
-
35
+
36
36
  dic_path = File.expand_path("../../../dictionaries/*", __FILE__)
37
-
37
+
38
38
  raise dic_path.inspect
39
-
39
+
40
40
  dic_folders = Dir.glob(dic_path).select {|d| File.directory?(d)}
41
-
41
+
42
42
  dic_folders.each do |folder|
43
43
  locale = folder.split("/").last
44
44
  word_file = File.join(folder, "#{locale}.ignore_words.dic")
45
45
  if File.exists?(word_file)
46
46
  File.open(word_file, "r").each_line do |word|
47
47
  SmartSearchIgnoreWord.create(:word => word.strip.downcase, :locale => locale)
48
- end
49
- end
50
- end
51
- end
52
-
53
-
54
-
55
-
56
- end
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+
54
+
55
+
56
+ end
57
57
 
58
58
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.79
4
+ version: 0.0.81
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Eck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-15 00:00:00.000000000 Z
11
+ date: 2017-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -109,15 +109,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  requirements: []
111
111
  rubyforge_project:
112
- rubygems_version: 2.4.5.1
112
+ rubygems_version: 2.6.12
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: Simple, easy to use search MySQL based search for ActiveRecord
116
116
  test_files:
117
117
  - test/test_document_multi_line.txt
118
+ - test/test_document_one_line.txt
118
119
  - test/test_helper.rb
119
- - test/unit/03_smart_search_boost_test.rb
120
- - test/unit/02_smart_search_similarity_test.rb
121
120
  - test/unit/01_smart_search_test.rb
122
- - test/test_document_one_line.txt
123
- has_rdoc:
121
+ - test/unit/02_smart_search_similarity_test.rb
122
+ - test/unit/03_smart_search_boost_test.rb