pgvector.git / summary / log / commit / refs

commit    02001343971412fef0f2ad8adf04bd6ac7b29d1f
Author:   Andrew Kane <andrew@ankane.org>
Date:     Sun May 28 19:14:10 2023 +0000

    Added note about hybrid search [skip ci]


README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index d10d750a..df17c4fb 100644 --- a/README.md +++ b/README.md @@ -250,6 +250,16 @@ Use [partitioning](https://www.postgresql.org/docs/current/ddl-partitioning.html CREATE TABLE items (embedding vector(3), category_id int) PARTITION BY LIST(category_id); ``` +## Hybrid Search + +Use together with Postgres [full-text search](https://www.postgresql.org/docs/current/textsearch-intro.html) for hybrid search. + +```sql +SELECT id, ts_rank_cd(textsearch, query) AS rank + FROM items, to_tsquery('hello & search') query + WHERE textsearch @@ query ORDER BY rank DESC LIMIT 5; +``` + ## Performance Use `EXPLAIN ANALYZE` to debug performance. [parent: ceddbac6bfa2]