smart_search 0.0.81 → 0.0.91

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: 4a9d6e89ffe0e662d4d946c4ccc502e66cf9c6aa
4
- data.tar.gz: c3e41c85265d845239081bb62307c801715b75cd
3
+ metadata.gz: 3b57cb82919d2ca20035a53bc79b48a9e39f173d
4
+ data.tar.gz: bbfe700ed2abdfcfcc126ce9378624c5608f8cb5
5
5
  SHA512:
6
- metadata.gz: '00598b98be8d13857268ee6cc5cfb294fc86b18a8068a709dc65a41f839cb62c5a4b61bfa7d276d8339b85e39631a149416e9650f4742e575194ded00ddc3f90'
7
- data.tar.gz: b236f7fa679dd09618d83630b4271657302bbbe730ef625e8b6696e0b4fdebb5e82415f22e44960ad596a95b442ea46fb0d96d3a59a3cf62c2bc370e4f9ca474
6
+ metadata.gz: d21748d7e69a23a1a3ae4f51111cf7fbb3213a0259c712aec37e655e9a58ff0060f423997ccfa03a20338d25883eff3663c1fd370b22fe0bc09eb7bc8199ce41
7
+ data.tar.gz: ab1731b0fc64b2bcd9d824df4260c993882a1ec7b2c7482c64930f1d876f26ae458d74b31048949ab91e6cb03d8755c379777607ecab7c627ab26558f54e5f19
data/lib/smart_search.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  require "rails"
3
3
 
4
4
  require "smart_search"
5
- require "smart_search/smart_search_engine"
5
+ require "smart_search/engine"
6
6
 
7
7
  require "smart_similarity"
8
8
  require "smart_search_history"
@@ -221,7 +221,11 @@ module SmartSearch
221
221
 
222
222
  @merged_tags.values.each do |t|
223
223
  if !t[:search_tags].blank? && t[:search_tags].size > 1
224
- SmartSearchTag.create(t.merge!(:table_name => self.class.table_name, :entry_id => self.id, :search_tags => t[:search_tags].strip.split(" ").uniq.join(" ")))
224
+ begin
225
+ SmartSearchTag.create(t.merge!(:table_name => self.class.table_name, :entry_id => self.id, :search_tags => t[:search_tags].strip.split(" ").uniq.join(" ")))
226
+ rescue Mysql2::Error => e
227
+
228
+ end
225
229
  end
226
230
  end
227
231
 
@@ -1,10 +1,12 @@
1
- # :nodoc:
2
1
  module SmartSearch
3
- require "rails"
4
- # :nodoc:
5
- class SmartSearchEngine < Rails::Engine
2
+ class Engine < Rails::Engine
3
+
4
+ engine_name 'smart_search'
5
+
6
6
  isolate_namespace SmartSearch
7
7
  require "friendly_extensions"
8
8
  require "amatch"
9
- end
10
- end
9
+
10
+ end
11
+ end
12
+
@@ -5,18 +5,6 @@ namespace :smart_search do
5
5
  SmartSimilarity.load_from_query_history
6
6
  end
7
7
 
8
- desc "Load similarity data from file - Use FILE=path/to/file to specify file"
9
- task :similarity_from_file => :environment do
10
- require File.expand_path("../../smart_similarity", __FILE__)
11
- if ENV['FILE_PATH'].nil?
12
- raise ArgumentError, "No file specified. "
13
- elsif !File.exist?(ENV['FILE_PATH'])
14
- raise ArgumentError, "File not found "
15
- else
16
- SmartSimilarity.load_file(ENV['FILE_PATH'])
17
- end
18
- end
19
-
20
8
  desc "Load similarity data from url - Use URL=http://.../ to specify url - Requires 'curl'"
21
9
  task :similarity_from_url => :environment do
22
10
  require File.expand_path("../../smart_similarity", __FILE__)
@@ -27,32 +15,6 @@ namespace :smart_search do
27
15
  end
28
16
  end
29
17
 
30
-
31
-
32
- desc "load ignore words list"
33
- task :load_ignore_words => :environment do
34
- require File.expand_path("../../smart_search_ignore_word", __FILE__)
35
-
36
- dic_path = File.expand_path("../../../dictionaries/*", __FILE__)
37
-
38
- raise dic_path.inspect
39
-
40
- dic_folders = Dir.glob(dic_path).select {|d| File.directory?(d)}
41
-
42
- dic_folders.each do |folder|
43
- locale = folder.split("/").last
44
- word_file = File.join(folder, "#{locale}.ignore_words.dic")
45
- if File.exists?(word_file)
46
- File.open(word_file, "r").each_line do |word|
47
- SmartSearchIgnoreWord.create(:word => word.strip.downcase, :locale => locale)
48
- end
49
- end
50
- end
51
- end
52
-
53
-
54
-
55
-
56
18
  end
57
19
 
58
20
 
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.81
4
+ version: 0.0.91
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Eck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-12 00:00:00.000000000 Z
11
+ date: 2018-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -77,9 +77,8 @@ files:
77
77
  - config/database.yml
78
78
  - config/routes.rb
79
79
  - lib/smart_search.rb
80
- - lib/smart_search/smart_search_engine.rb
80
+ - lib/smart_search/engine.rb
81
81
  - lib/smart_search_history.rb
82
- - lib/smart_search_ignore_word.rb
83
82
  - lib/smart_search_tag.rb
84
83
  - lib/smart_similarity.rb
85
84
  - lib/tasks/smart_search.rake
@@ -1,30 +0,0 @@
1
- # The keep words out of the index, they can be added into this table
2
- # TODO: Its not working yet
3
- class SmartSearchIgnoreWord < ActiveRecord::Base
4
-
5
- #= Configuration
6
- self.table_name = "smart_search_ignore_words"
7
- #== Associations
8
- # => Stuff in Here
9
-
10
- #== Plugins and modules
11
- #=== PlugIns
12
- # => Stuff in Here
13
-
14
- #=== include Modules
15
- # => Stuff in Here
16
-
17
- #== Konstanten
18
- # => Stuff in Here
19
-
20
- #== Validation and Callbacks
21
- #=== Validation
22
- validates_uniqueness_of :word
23
-
24
- #=== Callbacks
25
- # => Stuff in Here
26
-
27
-
28
- # => END
29
-
30
- end