Conversation
mhenrixon
force-pushed
the
2.3.6/single-association-performance
branch
3 times, most recently
from
January 25, 2023 20:18
c606a56 to
8d6bcfa
Compare
mhenrixon
force-pushed
the
2.3.6/single-association-performance
branch
9 times, most recently
from
August 16, 2023 16:47
4f528b8 to
1c633b5
Compare
|
This is a nice addition @mhenrixon thanks. |
Author
|
@Javierchik i haven't heard anything back at all. Someone posted on x.com searching for alternatives since pg_search seems dead or in maintenance mode. The guys on @37signals are working on a rails default for search so that's probably not too far away. Until then I am using this branch 🤷♂️ |
Lets a pg_search_scope search associated models through a precomputed
tsvector column instead of building to_tsvector(...) at query time:
pg_search_scope :search, associated_against: {
comments: { body_tsvector: { tsvector_column: true } }
}
- Column accepts `{ tsvector_column: true, weight: ... }` in place of a bare
weight and emits `coalesce(col::tsvector, '')` for such columns.
- Association selects cast to tsvector (singular) or aggregate with a new
`tsvector_agg` (plural) instead of string_agg(...::text).
- Tsearch skips the to_tsvector() wrap for tsvector columns.
- `pg_search:migration:associated_against_tsvector` generator installs the
`tsvector_agg` aggregate (sql/tsvector_agg.sql).
Rebased onto master (was PR Casecommons#504's 2.3.6-based branch), standardrb clean,
suite green on Ruby 4.0 / Active Record 8.1.
mhenrixon
force-pushed
the
2.3.6/single-association-performance
branch
from
September 1, 2026 05:45
bd63c85 to
5707315
Compare
Author
|
Superseded by #580 — same change rebased onto current master from a correctly named branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds alternative option syntax for tsvector_column. Adds migration for tsvector aggregation.
Adds support for tsvector columns in associated models.
Closes #499 in favor of this