alchemy-pg_search 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -5
- data/CHANGELOG.md +5 -0
- data/Gemfile +10 -7
- data/README.md +4 -4
- data/alchemy-pg_search.gemspec +15 -15
- data/app/helpers/alchemy/pg_search/search_helper.rb +7 -7
- data/bin/rails +6 -6
- data/bin/rspec +29 -0
- data/db/migrate/20210923081905_move_searchable_to_contents.rb +41 -0
- data/lib/alchemy/pg_search/content_extension.rb +23 -24
- data/lib/alchemy/pg_search/element_extension.rb +29 -16
- data/lib/alchemy/pg_search/engine.rb +4 -10
- data/lib/alchemy/pg_search/page_extension.rb +31 -18
- data/lib/alchemy/pg_search/version.rb +1 -1
- data/lib/alchemy-pg_search.rb +2 -2
- metadata +25 -25
- data/lib/alchemy/pg_search/searchable.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f7e0df77f37c90847ca65e06e9e857b1ce34c3967a5f4ad2b49b5b628a92216
|
4
|
+
data.tar.gz: f090bfccc9e38990d60047eaa41f7752ee6e96dbb9b80c7c7d0c747ab7296535
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e753341799782ba728dfffd808f0b8dfd3e4c224973858d6e04a0bcba28f234cff4f1bca64e7b74ef2f6f179523cfbc75df2824c3bab6fa2d09e31e59d836d7d
|
7
|
+
data.tar.gz: 612150eac4dba1e71277a325617ae84ae138eaec33b3ae7d330065255cd7f98a05f0094c508f5650f70edb981a716e664b919f43641f9a1dedfcaef1f39d5cd8
|
data/.travis.yml
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
3
|
rvm:
|
4
|
-
- 2.
|
5
|
-
|
4
|
+
- 2.5
|
5
|
+
services:
|
6
|
+
- postgresql
|
7
|
+
cache:
|
8
|
+
- bundler
|
6
9
|
branches:
|
7
10
|
only:
|
8
|
-
-
|
9
|
-
before_script:
|
10
|
-
script: rspec
|
11
|
+
- main
|
12
|
+
before_script: bundle exec rake alchemy:spec:prepare
|
13
|
+
script: bundle exec rspec
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 2.0.0 (2021-09-23)
|
2
|
+
|
3
|
+
- Move searchable attribute to contents table [#20](https://github.com/AlchemyCMS/alchemy-pg_search/pull/20) by [tvdeyen](https://github.com/tvdeyen)
|
4
|
+
- Support Alchemy 4.0 [#18](https://github.com/AlchemyCMS/alchemy-pg_search/pull/18) by [tvdeyen](https://github.com/tvdeyen)
|
5
|
+
|
1
6
|
## 1.2.0 (2018-11-28)
|
2
7
|
|
3
8
|
- Rename the #search method into #full_text_search [#14](https://github.com/AlchemyCMS/alchemy-pg_search/pull/14) by [tvdeyen](https://github.com/tvdeyen)
|
data/Gemfile
CHANGED
@@ -1,14 +1,17 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem
|
6
|
-
gem
|
7
|
-
gem
|
5
|
+
gem "rails", "~> 5.0.0"
|
6
|
+
gem "alchemy_cms", github: "AlchemyCMS/alchemy_cms", branch: "4.0-stable"
|
7
|
+
gem "sassc-rails"
|
8
|
+
gem "sassc", "< 2.2.0"
|
9
|
+
gem "pg", "< 1.0"
|
10
|
+
gem "puma"
|
8
11
|
|
9
12
|
group :test do
|
10
|
-
gem
|
13
|
+
gem "factory_bot_rails", "~> 4.8.0"
|
11
14
|
gem "capybara"
|
12
|
-
gem "pry"
|
13
|
-
gem
|
15
|
+
gem "pry-byebug"
|
16
|
+
gem "launchy"
|
14
17
|
end
|
data/README.md
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
[![Build Status](https://travis-ci.org/AlchemyCMS/alchemy-pg_search.svg?branch=
|
1
|
+
[![Build Status](https://travis-ci.org/AlchemyCMS/alchemy-pg_search.svg?branch=main)](https://travis-ci.org/AlchemyCMS/alchemy-pg_search)
|
2
2
|
|
3
3
|
# Alchemy CMS Postgresql Fulltext Search
|
4
4
|
|
5
|
-
This gem provides full text search for projects using postgresql databases to Alchemy CMS
|
5
|
+
This gem provides full text search for projects using postgresql databases to Alchemy CMS 4.0 and above.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
9
|
Add this line to your application's `Gemfile`:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem 'alchemy-pg_search', github: 'AlchemyCMS/alchemy-pg_search', branch: '
|
12
|
+
gem 'alchemy-pg_search', github: 'AlchemyCMS/alchemy-pg_search', branch: 'main'
|
13
13
|
```
|
14
14
|
|
15
15
|
And then execute:
|
@@ -120,7 +120,7 @@ en:
|
|
120
120
|
|
121
121
|
## Upgrading
|
122
122
|
|
123
|
-
If you are upgrading from an old Alchemy <
|
123
|
+
If you are upgrading from an old Alchemy < 4.0 based project that uses the ferret based full text search, please run this handy generator:
|
124
124
|
|
125
125
|
```shell
|
126
126
|
$ bin/rails g alchemy:pg_search:upgrade
|
data/alchemy-pg_search.gemspec
CHANGED
@@ -1,26 +1,26 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
|
3
|
+
|
4
|
+
require "alchemy/pg_search/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name
|
8
|
-
spec.version
|
9
|
-
spec.authors
|
10
|
-
spec.email
|
11
|
-
spec.description
|
12
|
-
spec.summary
|
13
|
-
spec.homepage
|
14
|
-
spec.license
|
7
|
+
spec.name = "alchemy-pg_search"
|
8
|
+
spec.version = Alchemy::PgSearch::VERSION
|
9
|
+
spec.authors = ["Thomas von Deyen"]
|
10
|
+
spec.email = ["thomas@vondeyen.com"]
|
11
|
+
spec.description = "PostgreSQL search for Alchemy CMS 4.0"
|
12
|
+
spec.summary = "This gem provides PostgreSQL full text search to Alchemy 4.0"
|
13
|
+
spec.homepage = "https://alchemy-cms.com"
|
14
|
+
spec.license = "BSD-3-Clause"
|
15
15
|
|
16
|
-
spec.files
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
-
spec.add_runtime_dependency "alchemy_cms", ["
|
20
|
-
spec.add_runtime_dependency "pg_search", ["~>
|
19
|
+
spec.add_runtime_dependency "alchemy_cms", [">= 4.0", "< 5.0"]
|
20
|
+
spec.add_runtime_dependency "pg_search", ["~> 2.1"]
|
21
21
|
spec.add_runtime_dependency "pg"
|
22
22
|
|
23
|
-
spec.add_development_dependency "bundler"
|
23
|
+
spec.add_development_dependency "bundler"
|
24
24
|
spec.add_development_dependency "rake"
|
25
25
|
spec.add_development_dependency "rspec-rails"
|
26
26
|
end
|
@@ -23,13 +23,13 @@ module Alchemy
|
|
23
23
|
# @option options class [String] (fulltext_search) The default css class of the form
|
24
24
|
# @option options id [String] (search) The default css id of the form
|
25
25
|
#
|
26
|
-
def render_search_form(options={})
|
26
|
+
def render_search_form(options = {})
|
27
27
|
default_options = {
|
28
28
|
html5: false,
|
29
|
-
class:
|
30
|
-
id:
|
29
|
+
class: "fulltext_search",
|
30
|
+
id: "search",
|
31
31
|
}
|
32
|
-
render
|
32
|
+
render "alchemy/search/form", options: default_options.merge(options), search_result_page: search_result_page
|
33
33
|
end
|
34
34
|
|
35
35
|
# Renders the search results partial within +app/views/alchemy/search/_results.html+
|
@@ -37,12 +37,12 @@ module Alchemy
|
|
37
37
|
# @option options show_result_count [Boolean] (true) Should the count of results be displayed or not?
|
38
38
|
# @option options show_heading [Boolean] (true) Should the heading be displayed or not?
|
39
39
|
#
|
40
|
-
def render_search_results(options={})
|
40
|
+
def render_search_results(options = {})
|
41
41
|
default_options = {
|
42
42
|
show_result_count: true,
|
43
|
-
show_heading: true
|
43
|
+
show_heading: true,
|
44
44
|
}
|
45
|
-
render
|
45
|
+
render "alchemy/search/results", options: default_options.merge(options)
|
46
46
|
end
|
47
47
|
|
48
48
|
def highlighted_excerpt(text, phrase, radius = 50)
|
data/bin/rails
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
|
3
3
|
|
4
|
-
ENGINE_ROOT = File.expand_path(
|
5
|
-
ENGINE_PATH = File.expand_path(
|
4
|
+
ENGINE_ROOT = File.expand_path("../..", __FILE__)
|
5
|
+
ENGINE_PATH = File.expand_path("../../lib/alchemy/pg_search/engine", __FILE__)
|
6
6
|
|
7
7
|
# Set up gems listed in the Gemfile.
|
8
|
-
ENV[
|
9
|
-
require
|
8
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
|
9
|
+
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
|
10
10
|
|
11
|
-
require
|
12
|
-
require
|
11
|
+
require "rails/all"
|
12
|
+
require "rails/engine/commands"
|
data/bin/rspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rspec' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rspec-core", "rspec")
|
@@ -0,0 +1,41 @@
|
|
1
|
+
class MoveSearchableToContents < ActiveRecord::Migration[5.0]
|
2
|
+
def change
|
3
|
+
add_column :alchemy_contents, :searchable, :boolean, default: true
|
4
|
+
|
5
|
+
{
|
6
|
+
Text: "texts",
|
7
|
+
Richtext: "richtexts",
|
8
|
+
Picture: "pictures",
|
9
|
+
}.each do |klass, table|
|
10
|
+
reversible do |dir|
|
11
|
+
dir.up do
|
12
|
+
Alchemy::Content.connection.execute <<~SQL
|
13
|
+
UPDATE alchemy_contents
|
14
|
+
SET searchable = alchemy_essence_#{table}.searchable
|
15
|
+
FROM alchemy_essence_#{table}
|
16
|
+
WHERE
|
17
|
+
alchemy_contents.essence_type = 'Alchemy::Essence#{klass}'
|
18
|
+
AND
|
19
|
+
alchemy_contents.essence_id = alchemy_essence_#{table}.id
|
20
|
+
SQL
|
21
|
+
end
|
22
|
+
|
23
|
+
dir.down do
|
24
|
+
Alchemy::Content.connection.execute <<~SQL
|
25
|
+
UPDATE alchemy_essence_#{table}
|
26
|
+
SET searchable = alchemy_contents.searchable
|
27
|
+
FROM alchemy_contents
|
28
|
+
WHERE
|
29
|
+
alchemy_contents.essence_type = 'Alchemy::Essence#{klass}'
|
30
|
+
AND
|
31
|
+
alchemy_contents.essence_id = alchemy_essence_#{table}.id
|
32
|
+
SQL
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
remove_column "alchemy_essence_#{table}", :searchable, default: true
|
37
|
+
end
|
38
|
+
|
39
|
+
change_column_null :alchemy_contents, :searchable, false, true
|
40
|
+
end
|
41
|
+
end
|
@@ -1,30 +1,29 @@
|
|
1
|
-
Alchemy::
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
def prepared_attributes_for_essence
|
9
|
-
attributes = {
|
10
|
-
ingredient: default_text(definition['default'])
|
11
|
-
}
|
12
|
-
if Alchemy::PgSearch.is_searchable_essence?(definition['type'])
|
13
|
-
attributes.merge!(searchable: definition.fetch('searchable', true))
|
1
|
+
module Alchemy::PgSearch::ContentExtension
|
2
|
+
module ClassMethods
|
3
|
+
def build(element, essence_hash)
|
4
|
+
definition = content_definition(element, essence_hash)
|
5
|
+
super.tap do |content|
|
6
|
+
content.searchable = definition.key?(:searchable) ? definition[:searchable] : true
|
7
|
+
end
|
14
8
|
end
|
15
|
-
|
9
|
+
|
10
|
+
Alchemy::Content.singleton_class.prepend self
|
16
11
|
end
|
17
12
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
13
|
+
module InstanceMethods
|
14
|
+
def searchable_ingredient
|
15
|
+
case essence_type
|
16
|
+
when "Alchemy::EssencePicture"
|
17
|
+
essence.caption
|
18
|
+
when "Alchemy::EssenceRichtext"
|
19
|
+
essence.stripped_body
|
20
|
+
when "Alchemy::EssenceText"
|
21
|
+
essence.body
|
22
|
+
else
|
23
|
+
ingredient
|
24
|
+
end
|
28
25
|
end
|
26
|
+
|
27
|
+
Alchemy::Content.prepend self
|
29
28
|
end
|
30
29
|
end
|
@@ -1,40 +1,53 @@
|
|
1
1
|
Alchemy::Element.class_eval do
|
2
|
-
include PgSearch
|
2
|
+
include PgSearch::Model
|
3
3
|
|
4
4
|
pg_search_scope :full_text_search,
|
5
5
|
associated_against: {
|
6
|
-
searchable_essence_texts:
|
6
|
+
searchable_essence_texts: :body,
|
7
7
|
searchable_essence_richtexts: :stripped_body,
|
8
|
-
searchable_essence_pictures:
|
8
|
+
searchable_essence_pictures: :caption,
|
9
9
|
},
|
10
10
|
using: {
|
11
|
-
tsearch: {prefix: true}
|
11
|
+
tsearch: { prefix: true },
|
12
12
|
}
|
13
13
|
|
14
14
|
has_many :searchable_essence_texts,
|
15
|
-
-> {
|
16
|
-
|
17
|
-
|
15
|
+
-> {
|
16
|
+
includes(:element)
|
17
|
+
.where(alchemy_contents: { searchable: true })
|
18
|
+
.where(alchemy_elements: { public: true })
|
19
|
+
},
|
20
|
+
class_name: "Alchemy::EssenceText",
|
21
|
+
source_type: "Alchemy::EssenceText",
|
18
22
|
through: :contents,
|
19
23
|
source: :essence
|
20
24
|
|
21
25
|
has_many :searchable_essence_richtexts,
|
22
|
-
-> {
|
23
|
-
|
24
|
-
|
26
|
+
-> {
|
27
|
+
includes(:element)
|
28
|
+
.where(alchemy_contents: { searchable: true })
|
29
|
+
.where(alchemy_elements: { public: true })
|
30
|
+
},
|
31
|
+
class_name: "Alchemy::EssenceRichtext",
|
32
|
+
source_type: "Alchemy::EssenceRichtext",
|
25
33
|
through: :contents,
|
26
34
|
source: :essence
|
27
35
|
|
28
36
|
has_many :searchable_essence_pictures,
|
29
|
-
-> {
|
30
|
-
|
31
|
-
|
37
|
+
-> {
|
38
|
+
includes(:element)
|
39
|
+
.where(alchemy_contents: { searchable: true })
|
40
|
+
.where(alchemy_elements: { public: true })
|
41
|
+
},
|
42
|
+
class_name: "Alchemy::EssencePicture",
|
43
|
+
source_type: "Alchemy::EssencePicture",
|
32
44
|
through: :contents,
|
33
45
|
source: :essence
|
34
46
|
|
35
47
|
has_many :searchable_contents,
|
36
|
-
-> {
|
37
|
-
|
48
|
+
-> {
|
49
|
+
where(essence_type: Alchemy::PgSearch::SEARCHABLE_ESSENCES.map { |k| "Alchemy::#{k}" })
|
50
|
+
},
|
51
|
+
class_name: "Alchemy::Content",
|
38
52
|
source: :contents
|
39
|
-
|
40
53
|
end
|
@@ -1,25 +1,19 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "alchemy_cms"
|
2
|
+
require "pg_search"
|
3
3
|
|
4
4
|
module Alchemy
|
5
5
|
module PgSearch
|
6
6
|
class Engine < ::Rails::Engine
|
7
|
-
engine_name
|
7
|
+
engine_name "alchemy_pg_search"
|
8
8
|
|
9
9
|
config.to_prepare do
|
10
10
|
require_relative "./content_extension"
|
11
|
-
require_relative
|
11
|
+
require_relative "./controller_methods"
|
12
12
|
require_relative "./element_extension"
|
13
13
|
require_relative "./page_extension"
|
14
|
-
require_relative './searchable'
|
15
14
|
|
16
15
|
# We need to have the search methods present in all Alchemy controllers
|
17
16
|
Alchemy::BaseController.send(:include, Alchemy::PgSearch::ControllerMethods)
|
18
|
-
|
19
|
-
# Inject searchable attribute persistence into searchable essence classes
|
20
|
-
Alchemy::PgSearch.searchable_essence_classes.each do |klass|
|
21
|
-
klass.send(:include, Alchemy::PgSearch::Searchable)
|
22
|
-
end
|
23
17
|
end
|
24
18
|
end
|
25
19
|
end
|
@@ -1,41 +1,54 @@
|
|
1
1
|
Alchemy::Page.class_eval do
|
2
|
-
include PgSearch
|
2
|
+
include PgSearch::Model
|
3
3
|
|
4
4
|
# Enable Postgresql full text indexing.
|
5
5
|
#
|
6
|
-
pg_search_scope :full_text_search,
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
pg_search_scope :full_text_search,
|
7
|
+
against: {
|
8
|
+
meta_description: "B",
|
9
|
+
meta_keywords: "B",
|
10
|
+
title: "B",
|
11
|
+
name: "A",
|
11
12
|
},
|
12
13
|
associated_against: {
|
13
|
-
searchable_essence_texts:
|
14
|
+
searchable_essence_texts: :body,
|
14
15
|
searchable_essence_richtexts: :stripped_body,
|
15
|
-
searchable_essence_pictures:
|
16
|
+
searchable_essence_pictures: :caption,
|
16
17
|
},
|
17
18
|
using: {
|
18
|
-
tsearch: {prefix: true}
|
19
|
+
tsearch: { prefix: true },
|
19
20
|
}
|
20
21
|
|
21
22
|
has_many :searchable_essence_texts,
|
22
|
-
-> {
|
23
|
-
|
24
|
-
|
23
|
+
-> {
|
24
|
+
includes(:element)
|
25
|
+
.where(alchemy_contents: { searchable: true })
|
26
|
+
.where(alchemy_elements: { public: true })
|
27
|
+
},
|
28
|
+
class_name: "Alchemy::EssenceText",
|
29
|
+
source_type: "Alchemy::EssenceText",
|
25
30
|
through: :descendent_contents,
|
26
31
|
source: :essence
|
27
32
|
|
28
33
|
has_many :searchable_essence_richtexts,
|
29
|
-
-> {
|
30
|
-
|
31
|
-
|
34
|
+
-> {
|
35
|
+
includes(:element)
|
36
|
+
.where(alchemy_contents: { searchable: true })
|
37
|
+
.where(alchemy_elements: { public: true })
|
38
|
+
},
|
39
|
+
class_name: "Alchemy::EssenceRichtext",
|
40
|
+
source_type: "Alchemy::EssenceRichtext",
|
32
41
|
through: :descendent_contents,
|
33
42
|
source: :essence
|
34
43
|
|
35
44
|
has_many :searchable_essence_pictures,
|
36
|
-
-> {
|
37
|
-
|
38
|
-
|
45
|
+
-> {
|
46
|
+
includes(:element)
|
47
|
+
.where(alchemy_contents: { searchable: true })
|
48
|
+
.where(alchemy_elements: { public: true })
|
49
|
+
},
|
50
|
+
class_name: "Alchemy::EssencePicture",
|
51
|
+
source_type: "Alchemy::EssencePicture",
|
39
52
|
through: :descendent_contents,
|
40
53
|
source: :essence
|
41
54
|
|
data/lib/alchemy-pg_search.rb
CHANGED
@@ -4,9 +4,9 @@ require "alchemy/pg_search/page_search_scope"
|
|
4
4
|
|
5
5
|
module Alchemy
|
6
6
|
module PgSearch
|
7
|
-
SEARCHABLE_ESSENCES = %w
|
7
|
+
SEARCHABLE_ESSENCES = %w[EssenceText EssenceRichtext EssencePicture]
|
8
8
|
DEFAULT_CONFIG = {
|
9
|
-
page_search_scope: PageSearchScope.new
|
9
|
+
page_search_scope: PageSearchScope.new,
|
10
10
|
}
|
11
11
|
|
12
12
|
extend Config
|
metadata
CHANGED
@@ -1,49 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy-pg_search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas von Deyen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: alchemy_cms
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4.0'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '5.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - "
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '4.0'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '5.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: pg_search
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
39
|
+
version: '2.1'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '2.1'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: pg
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -62,16 +62,16 @@ dependencies:
|
|
62
62
|
name: bundler
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - "
|
65
|
+
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
67
|
+
version: '0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- - "
|
72
|
+
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
74
|
+
version: '0'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: rake
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,9 +100,9 @@ dependencies:
|
|
100
100
|
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
|
-
description: PostgreSQL search for Alchemy CMS
|
103
|
+
description: PostgreSQL search for Alchemy CMS 4.0
|
104
104
|
email:
|
105
|
-
-
|
105
|
+
- thomas@vondeyen.com
|
106
106
|
executables: []
|
107
107
|
extensions: []
|
108
108
|
extra_rdoc_files: []
|
@@ -120,11 +120,13 @@ files:
|
|
120
120
|
- app/views/alchemy/search/_result.html.erb
|
121
121
|
- app/views/alchemy/search/_results.html.erb
|
122
122
|
- bin/rails
|
123
|
+
- bin/rspec
|
123
124
|
- config/locales/alchemy.search.de.yml
|
124
125
|
- config/locales/alchemy.search.en.yml
|
125
126
|
- db/migrate/20141211105526_add_searchable_to_alchemy_essence_texts.rb
|
126
127
|
- db/migrate/20141211105942_add_searchable_to_alchemy_essence_richtexts.rb
|
127
128
|
- db/migrate/20141211110126_add_searchable_to_alchemy_essence_pictures.rb
|
129
|
+
- db/migrate/20210923081905_move_searchable_to_contents.rb
|
128
130
|
- lib/alchemy-pg_search.rb
|
129
131
|
- lib/alchemy/pg_search/config.rb
|
130
132
|
- lib/alchemy/pg_search/content_extension.rb
|
@@ -133,17 +135,16 @@ files:
|
|
133
135
|
- lib/alchemy/pg_search/engine.rb
|
134
136
|
- lib/alchemy/pg_search/page_extension.rb
|
135
137
|
- lib/alchemy/pg_search/page_search_scope.rb
|
136
|
-
- lib/alchemy/pg_search/searchable.rb
|
137
138
|
- lib/alchemy/pg_search/version.rb
|
138
139
|
- lib/generators/alchemy/pg_search/upgrade/templates/migration.rb.tt
|
139
140
|
- lib/generators/alchemy/pg_search/upgrade/upgrade_generator.rb
|
140
141
|
- lib/generators/alchemy/pg_search/views/views_generator.rb
|
141
142
|
- lib/tasks/alchemy/pg_search_tasks.rake
|
142
|
-
homepage:
|
143
|
+
homepage: https://alchemy-cms.com
|
143
144
|
licenses:
|
144
|
-
- BSD
|
145
|
+
- BSD-3-Clause
|
145
146
|
metadata: {}
|
146
|
-
post_install_message:
|
147
|
+
post_install_message:
|
147
148
|
rdoc_options: []
|
148
149
|
require_paths:
|
149
150
|
- lib
|
@@ -158,9 +159,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
159
|
- !ruby/object:Gem::Version
|
159
160
|
version: '0'
|
160
161
|
requirements: []
|
161
|
-
|
162
|
-
|
163
|
-
signing_key:
|
162
|
+
rubygems_version: 3.2.27
|
163
|
+
signing_key:
|
164
164
|
specification_version: 4
|
165
|
-
summary: This gem provides PostgreSQL full text search to Alchemy
|
165
|
+
summary: This gem provides PostgreSQL full text search to Alchemy 4.0
|
166
166
|
test_files: []
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module Alchemy
|
2
|
-
module PgSearch
|
3
|
-
|
4
|
-
# Ensures that the current content definition value for +searchable+ gets persisted.
|
5
|
-
#
|
6
|
-
# It is enabled per default, but you can disable indexing in your +elements.yml+ file.
|
7
|
-
#
|
8
|
-
# === Example
|
9
|
-
#
|
10
|
-
# name: secrets
|
11
|
-
# contents:
|
12
|
-
# - name: confidential
|
13
|
-
# type: EssenceRichtext
|
14
|
-
# searchable: false
|
15
|
-
#
|
16
|
-
module Searchable
|
17
|
-
extend ActiveSupport::Concern
|
18
|
-
|
19
|
-
included do
|
20
|
-
before_update do
|
21
|
-
write_attribute(:searchable, definition.fetch('searchable', true))
|
22
|
-
true
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|