full_search 0.4.7 → 0.4.8
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f50c2f24f4b4929d3da0744d93e33a0b6c5a6ba3743c4542612c6e1007687691
|
|
4
|
+
data.tar.gz: d497857811078992322ad4cd081e41aa476878c0950b71a2ec5bcd7a76ff8db2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bf77188446fed43a0e9f69826f85ced628f5960d493cbd96d721730e9fd9d8c92ffe5c58412aee47e81feb01adca00e2e7b7641f85ea01fe2c98fcaaca05b5f1
|
|
7
|
+
data.tar.gz: 89e0b8dc7ee2b44391deb5c339e2b048c836431a5997ab19c281285b1fef79fcfe5ad4fea02793a672643899e08e5276a12dbadacf51cb3411853d389c6fbbf7
|
data/lib/full_search/search.rb
CHANGED
|
@@ -85,7 +85,8 @@ module FullSearch
|
|
|
85
85
|
def check_stale_config!
|
|
86
86
|
if FullSearch::Index.missing_table?(model)
|
|
87
87
|
if FullSearch.config.auto_rebuild_missing_tables
|
|
88
|
-
FullSearch
|
|
88
|
+
FullSearch.logger.info("[full_search] Auto-creating missing FTS table for #{model.table_name}")
|
|
89
|
+
FullSearch::Index.ensure_table!(model)
|
|
89
90
|
return
|
|
90
91
|
end
|
|
91
92
|
|
data/lib/full_search/version.rb
CHANGED
data/lib/full_search.rb
CHANGED
|
@@ -72,6 +72,16 @@ module FullSearch
|
|
|
72
72
|
def bulk_importing?(model)
|
|
73
73
|
BulkImport.bulk_importing?(model)
|
|
74
74
|
end
|
|
75
|
+
|
|
76
|
+
def logger
|
|
77
|
+
return @logger if defined?(@logger) && @logger
|
|
78
|
+
|
|
79
|
+
@logger = if defined?(Rails) && Rails.respond_to?(:logger) && Rails.logger
|
|
80
|
+
Rails.logger
|
|
81
|
+
else
|
|
82
|
+
Logger.new(File::NULL)
|
|
83
|
+
end
|
|
84
|
+
end
|
|
75
85
|
end
|
|
76
86
|
end
|
|
77
87
|
|
|
@@ -5,6 +5,9 @@ FullSearch.configure do |config|
|
|
|
5
5
|
|
|
6
6
|
config.auto_rebuild_on_stale_query = Rails.env.local?
|
|
7
7
|
|
|
8
|
+
# Auto-create missing FTS tables on first query in dev/test instead of raising.
|
|
9
|
+
config.auto_rebuild_missing_tables = Rails.env.local?
|
|
10
|
+
|
|
8
11
|
config.stale_query_behavior = Rails.env.production? ? :log_and_fallback : :raise
|
|
9
12
|
|
|
10
13
|
config.lock_rebuilds = true
|