Search feature repaired
This commit is contained in:
parent
f940e96014
commit
f3a8b7c3a5
8 changed files with 60 additions and 29 deletions
29
README.Developer
Normal file
29
README.Developer
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# Full text search
|
||||
|
||||
The pg_search Ruby gem is used for full-text searched in Rails.
|
||||
See: https://github.com/Casecommons/pg_search
|
||||
|
||||
Reformatted SQL query for fulltext search:
|
||||
|
||||
SELECT COUNT(*) FROM "packages" WHERE (
|
||||
(
|
||||
(
|
||||
to_tsvector('simple', coalesce("packages"."name"::text, ''))
|
||||
||
|
||||
to_tsvector('simple', coalesce("packages"."description"::text, ''))
|
||||
||
|
||||
to_tsvector('simple', coalesce("packages"."long_description"::text, ''))
|
||||
)
|
||||
@@
|
||||
(
|
||||
to_tsquery('simple', '''' || 'browser' || ' ''')
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
# Index:
|
||||
|
||||
CREATE INDEX packages_gin ON packages USING GIN( (to_tsvector('simple',
|
||||
coalesce("packages"."name"::text, '')) || to_tsvector('simple',
|
||||
coalesce("packages"."description"::text, '')) || to_tsvector('simple',
|
||||
coalesce("packages"."long_description"::text, ''))) );
|
||||
Loading…
Add table
Add a link
Reference in a new issue