alchemy-pg_search 7.4.0 → 8.0.0
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/.github/workflows/ci.yml +1 -1
- data/.github/workflows/release.yml +1 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -5
- data/Gemfile +1 -1
- data/README.md +10 -0
- data/alchemy-pg_search.gemspec +1 -1
- data/app/extensions/alchemy/search/element_extension.rb +1 -1
- data/app/extensions/alchemy/search/ingredient_extension.rb +1 -1
- data/app/extensions/alchemy/search/page_extension.rb +1 -2
- data/app/services/alchemy/search/search_page.rb +5 -5
- data/bin/setup +42 -0
- data/lib/alchemy/pg_search/engine.rb +1 -1
- data/lib/alchemy/pg_search/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 62c44d2e487f8296eb9f4739662d146f66b1777259c4aeaf650989166afa5ab4
|
|
4
|
+
data.tar.gz: 39b4b40b8ac6db6eb3c0c951c2d9a2fdb687138a57a70547d0e1e76ac322fac0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e68e94e0931c5bb4e6fa0f12eb77cc0222ffac071995b745daafdce847082b9f2c63e902a213c6046bf8a669c8dd7a272bb6d2d841aef5278f6b6bee356c182
|
|
7
|
+
data.tar.gz: 86246d85296783101bc52999e42e39a83955e2f0649e7499d7b5bf1e41aa72fca47ba1422dbcd2911c1d4c029032a05d7bd96521c4c6a061a5ca147429f6fa02
|
data/.github/workflows/ci.yml
CHANGED
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 8.0.0 (2026-03-17)
|
|
4
4
|
|
|
5
5
|
## What's Changed
|
|
6
|
-
* Add
|
|
7
|
-
*
|
|
8
|
-
* Update Alchemy to v7.4.x by @sascha-karnatz in https://github.com/AlchemyCMS/alchemy-pg_search/pull/68
|
|
6
|
+
* Add bin/setup script by @sascha-karnatz in https://github.com/AlchemyCMS/alchemy-pg_search/pull/70
|
|
7
|
+
* Upgrade Alchemy v8.0 by @sascha-karnatz in https://github.com/AlchemyCMS/alchemy-pg_search/pull/69
|
|
9
8
|
|
|
10
9
|
|
|
11
|
-
**Full Changelog**: https://github.com/AlchemyCMS/alchemy-pg_search/compare/
|
|
10
|
+
**Full Changelog**: https://github.com/AlchemyCMS/alchemy-pg_search/compare/v7.4.0...v8.0.0
|
|
12
11
|
|
|
13
12
|
## [v6.1.0](https://github.com/AlchemyCMS/alchemy-pg_search/tree/v6.1.0) (2024-12-13)
|
|
14
13
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -236,6 +236,16 @@ and reindex your database in your Rails console
|
|
|
236
236
|
$ Alchemy::PgSearch.rebuild
|
|
237
237
|
```
|
|
238
238
|
|
|
239
|
+
## Local Development
|
|
240
|
+
|
|
241
|
+
Run the setup script to install dependencies and prepare the dummy app:
|
|
242
|
+
|
|
243
|
+
```shell
|
|
244
|
+
$ bin/setup
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
This installs gems, runs the Alchemy and PgSearch installers, and clears temporary files.
|
|
248
|
+
|
|
239
249
|
## Contributing
|
|
240
250
|
|
|
241
251
|
1. Fork it
|
data/alchemy-pg_search.gemspec
CHANGED
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
|
18
18
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
|
|
19
19
|
spec.require_paths = ["lib"]
|
|
20
20
|
|
|
21
|
-
spec.add_runtime_dependency "alchemy_cms", [">= 7
|
|
21
|
+
spec.add_runtime_dependency "alchemy_cms", [">= 8.0.7", "< 9"]
|
|
22
22
|
spec.add_runtime_dependency "pg_search", ["~> 2.1"]
|
|
23
23
|
spec.add_runtime_dependency "pg"
|
|
24
24
|
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
#
|
|
3
3
|
module Alchemy::Search::PageExtension
|
|
4
4
|
def searchable?
|
|
5
|
-
|
|
6
|
-
searchable && public? && !layoutpage?
|
|
5
|
+
definition.searchable && searchable && public? && !layoutpage?
|
|
7
6
|
end
|
|
8
7
|
|
|
9
8
|
def searchable_content
|
|
@@ -21,17 +21,17 @@ module Alchemy
|
|
|
21
21
|
|
|
22
22
|
def self.search_result_page
|
|
23
23
|
@search_result_page ||= begin
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
page_definitions = ::Alchemy::PageDefinition.all.select do |page_definition|
|
|
25
|
+
page_definition.searchresults
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
if
|
|
28
|
+
if page_definitions.nil?
|
|
29
29
|
raise "No searchresults page layout found. Please add page layout with `searchresults: true` into your `page_layouts.yml` file."
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
page = Page.published.find_by(
|
|
33
|
-
page_layout:
|
|
34
|
-
language_id:
|
|
33
|
+
page_layout: page_definitions.first.name,
|
|
34
|
+
language_id: ::Alchemy::Current.language.id,
|
|
35
35
|
)
|
|
36
36
|
if page.nil?
|
|
37
37
|
logger.warn "\n++++++\nNo published search result page found. Please create one or publish your search result page.\n++++++\n"
|
data/bin/setup
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require "fileutils"
|
|
3
|
+
|
|
4
|
+
# path to dummy application root.
|
|
5
|
+
APP_ROOT = File.expand_path("../spec/dummy", __dir__)
|
|
6
|
+
|
|
7
|
+
# path to alchemy gem
|
|
8
|
+
GEM_ROOT = File.expand_path("../", __dir__)
|
|
9
|
+
|
|
10
|
+
def system!(*args)
|
|
11
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
FileUtils.chdir GEM_ROOT do
|
|
15
|
+
system! "gem install bundler --conservative"
|
|
16
|
+
system("bundle check") || system!("bundle install")
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
FileUtils.chdir APP_ROOT do
|
|
20
|
+
puts "\n== Remove migration files for dummy app =="
|
|
21
|
+
Dir.glob("db/migrate/*.rb")
|
|
22
|
+
.reject { |f| f.include?("create_users") || f.include?("pg_search_documents") }
|
|
23
|
+
.each { |f| FileUtils.rm(f) }
|
|
24
|
+
|
|
25
|
+
puts "\n== Create database for dummy app =="
|
|
26
|
+
system!("bin/rails db:drop")
|
|
27
|
+
system!("bin/rails db:create")
|
|
28
|
+
|
|
29
|
+
puts "\n== Installing Alchemy CMS into dummy app =="
|
|
30
|
+
system!("bin/rails g alchemy:install --skip --skip-demo-files --auto-accept")
|
|
31
|
+
|
|
32
|
+
puts "\n== Installing Alchemy PGSearch into dummy app =="
|
|
33
|
+
system!("bin/rails g alchemy:pg_search:install")
|
|
34
|
+
|
|
35
|
+
puts "\n== Removing old logs and tempfiles =="
|
|
36
|
+
system! "bin/rails log:clear tmp:clear"
|
|
37
|
+
|
|
38
|
+
puts "\n== Removing old logs and tempfiles =="
|
|
39
|
+
system! "RAILS_ENV=test bin/rails db:schema:load"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
puts "\n== Alchemy PgSearch is ready 🎉 =="
|
|
@@ -14,7 +14,7 @@ module Alchemy
|
|
|
14
14
|
# In development environment, this runs on every code reload, so avoid multiple reindexing jobs
|
|
15
15
|
unless Alchemy.publish_targets.map(&:name).include? 'Alchemy::PgSearch::IndexPageJob'
|
|
16
16
|
# reindex the page after it was published
|
|
17
|
-
Alchemy.publish_targets << Alchemy::PgSearch::IndexPageJob
|
|
17
|
+
Alchemy.config.publish_targets << "Alchemy::PgSearch::IndexPageJob"
|
|
18
18
|
end
|
|
19
19
|
# enable searchable flag in page form
|
|
20
20
|
Alchemy.enable_searchable = true
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: alchemy-pg_search
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 8.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Thomas von Deyen
|
|
@@ -15,20 +15,20 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version:
|
|
18
|
+
version: 8.0.7
|
|
19
19
|
- - "<"
|
|
20
20
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: '
|
|
21
|
+
version: '9'
|
|
22
22
|
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
25
|
requirements:
|
|
26
26
|
- - ">="
|
|
27
27
|
- !ruby/object:Gem::Version
|
|
28
|
-
version:
|
|
28
|
+
version: 8.0.7
|
|
29
29
|
- - "<"
|
|
30
30
|
- !ruby/object:Gem::Version
|
|
31
|
-
version: '
|
|
31
|
+
version: '9'
|
|
32
32
|
- !ruby/object:Gem::Dependency
|
|
33
33
|
name: pg_search
|
|
34
34
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -130,6 +130,7 @@ files:
|
|
|
130
130
|
- app/views/alchemy/search/_results.html.erb
|
|
131
131
|
- bin/rails
|
|
132
132
|
- bin/rspec
|
|
133
|
+
- bin/setup
|
|
133
134
|
- config/locales/alchemy.search.de.yml
|
|
134
135
|
- config/locales/alchemy.search.en.yml
|
|
135
136
|
- db/migrate/20220826125413_add_page_id_column_to_pg_search_documents.rb
|