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 +4 -4
- data/lib/smart_search.rb +1 -1
- data/lib/tasks/smart_search.rake +22 -22
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a9d6e89ffe0e662d4d946c4ccc502e66cf9c6aa
|
4
|
+
data.tar.gz: c3e41c85265d845239081bb62307c801715b75cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/tasks/smart_search.rake
CHANGED
@@ -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.
|
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:
|
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.
|
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/
|
123
|
-
|
121
|
+
- test/unit/02_smart_search_similarity_test.rb
|
122
|
+
- test/unit/03_smart_search_boost_test.rb
|