smart_search 0.0.91 → 0.0.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/database.yml +0 -0
- data/lib/smart_search/engine.rb +0 -0
- data/lib/smart_search.rb +1 -1
- data/lib/smart_search_history.rb +0 -0
- data/lib/smart_search_tag.rb +0 -0
- data/lib/smart_similarity.rb +2 -2
- data/lib/tasks/smart_search.rake +0 -0
- data/lib/tasks/testing.rake +0 -0
- data/test/test_document_multi_line.txt +0 -0
- data/test/test_document_one_line.txt +0 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2eea1ae08ee42a272bb6c46e9be0879bdc998e45
|
4
|
+
data.tar.gz: eb172e38f3cfac374fc8f2dc7f42a0cee93ee152
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10d57223b4205896105c73232d15501d2d28f54de3ea6f95f223e444c61d027751ef499b40e03be6ba2eb0587851ed51b0fac509c9fe934b054a123571122969
|
7
|
+
data.tar.gz: 6938b923f45869af837e34c333f3105cc8e3da3577373bf4c3942253b085ed73aa1a54899aea64245655a886ca832ebc568b8da5651220ccb60c52fc49310962
|
data/config/database.yml
CHANGED
File without changes
|
data/lib/smart_search/engine.rb
CHANGED
File without changes
|
data/lib/smart_search.rb
CHANGED
@@ -223,7 +223,7 @@ module SmartSearch
|
|
223
223
|
if !t[:search_tags].blank? && t[:search_tags].size > 1
|
224
224
|
begin
|
225
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
|
226
|
+
rescue Exception => e
|
227
227
|
|
228
228
|
end
|
229
229
|
end
|
data/lib/smart_search_history.rb
CHANGED
File without changes
|
data/lib/smart_search_tag.rb
CHANGED
File without changes
|
data/lib/smart_similarity.rb
CHANGED
@@ -16,7 +16,7 @@ class SmartSimilarity < ActiveRecord::Base
|
|
16
16
|
|
17
17
|
#== Konstanten
|
18
18
|
# Defines the min. result of word simililarity check
|
19
|
-
SIMILARITY_FACTOR = 0.
|
19
|
+
SIMILARITY_FACTOR = 0.78
|
20
20
|
# Defines first simililarity check method
|
21
21
|
SIMILARITY_METHOD_1 = :jarowinkler
|
22
22
|
# Defines first simililarity check method
|
@@ -75,7 +75,7 @@ class SmartSimilarity < ActiveRecord::Base
|
|
75
75
|
def self.add_word(word)
|
76
76
|
words = [word]
|
77
77
|
phrases = self.connection.select_all("SELECT phrase from smart_search_similarities").map {|r| r["phrase"] }
|
78
|
-
words += phrases.select {|p| self.match_words(p,word) >= SIMILARITY_FACTOR }
|
78
|
+
words += phrases.select {|p| self.match_words(p,word) >= SIMILARITY_FACTOR && (word.size - p.size).abs < 2 }
|
79
79
|
|
80
80
|
self.create_from_text(words.join(" "))
|
81
81
|
end
|
data/lib/tasks/smart_search.rake
CHANGED
File without changes
|
data/lib/tasks/testing.rake
CHANGED
File without changes
|
File without changes
|
File without changes
|
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.96
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Eck
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: unicode-emoji
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description: SmartSearch adds full-text search functions to ActiveRecord running with
|
70
84
|
MySQL, including search for similiar words. Its fast, simple, and works with almost
|
71
85
|
zero-config!
|