Skip to content

[Feature]: Add Postgres search extension pg_search #1926

Open
@carlos-verdes

Description

@carlos-verdes

Describe the feature

Install search extension pg_search from ParadeDB.
This will enable an 'Elastic Search like' search index inside Postgres.

https://docs.paradedb.com/deploy/self-hosted/extensions

Suggestion or Example of how the feature would be used

As part of your SQL migration scripts you have to create the search index you need:

CREATE INDEX search_idx ON mock_items
USING bm25 (id, description, category, rating, in_stock, created_at, metadata, weight_range)
WITH (key_field='id');

Then you can use @@@ operator to do text search:

SELECT description, rating, category, paradedb.score(id)
FROM mock_items
WHERE description @@@ 'shoes' OR category @@@ 'footwear' AND rating @@@ '>2'
ORDER BY score DESC, description
LIMIT 5;

More information on how to use it here

Duplicate declaration

  • I have searched the issues and this feature has not been requested before.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-TriageAwaiting decision for what to doT-Feature RequestA request for a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions