full_search 0.4.0 → 0.4.1
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/lib/full_search/config.rb +2 -1
- data/lib/full_search/search.rb +5 -0
- data/lib/full_search/test_helpers.rb +1 -0
- data/lib/full_search/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1fb6eb3fd61b593c1cbea4a28c2db11d73ed11abd422f1685d6e31422cec6607
|
|
4
|
+
data.tar.gz: c8553a64b3e0b111e311478c448d6f9de5f826b122d3c3f64cd22b92b6020f25
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 71fe8b5515334c6eaf826022f34c415459365856ae0a38115dde0a984e23d8cd0dfae90ece9d05b07605c7942e2a2edf4d98dd0fdb35a3e0ecaaf4d2f0f86a2e
|
|
7
|
+
data.tar.gz: df84b3bcffde7393428589dc3bed5c92a7b50974ea027829c20c800760a2b69b7bbf3a3170e96fef232892d5e1461cb230715e6e2ec06a01d4dc46cf9b4750f2
|
data/lib/full_search/config.rb
CHANGED
|
@@ -5,7 +5,7 @@ module FullSearch
|
|
|
5
5
|
attr_accessor :auto_rebuild_schema, :stale_query_behavior, :lock_rebuilds,
|
|
6
6
|
:default_async_reindex, :default_async_source_reindex,
|
|
7
7
|
:default_tokenizer, :auto_rebuild_on_stale_query, :min_like_prefix_length,
|
|
8
|
-
:dump_schema_virtual_tables
|
|
8
|
+
:dump_schema_virtual_tables, :auto_rebuild_missing_tables
|
|
9
9
|
|
|
10
10
|
def initialize
|
|
11
11
|
@auto_rebuild_schema = false
|
|
@@ -17,6 +17,7 @@ module FullSearch
|
|
|
17
17
|
@auto_rebuild_on_stale_query = false
|
|
18
18
|
@min_like_prefix_length = FullSearch::Constants::DEFAULT_MIN_LIKE_PREFIX_LENGTH
|
|
19
19
|
@dump_schema_virtual_tables = true
|
|
20
|
+
@auto_rebuild_missing_tables = false
|
|
20
21
|
end
|
|
21
22
|
end
|
|
22
23
|
|
data/lib/full_search/search.rb
CHANGED
|
@@ -84,6 +84,11 @@ module FullSearch
|
|
|
84
84
|
|
|
85
85
|
def check_stale_config!
|
|
86
86
|
if FullSearch::Index.missing_table?(model)
|
|
87
|
+
if FullSearch.config.auto_rebuild_missing_tables
|
|
88
|
+
FullSearch::Index.rebuild!(model)
|
|
89
|
+
return
|
|
90
|
+
end
|
|
91
|
+
|
|
87
92
|
raise MissingTableError, "FTS table `#{FullSearch::Index.fts_table_name(model)}` does not exist. Run `bin/rails full_search:prepare` to create it."
|
|
88
93
|
end
|
|
89
94
|
|
data/lib/full_search/version.rb
CHANGED