mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-11 23:26:55 +08:00
Added note about hybrid search [skip ci]
This commit is contained in:
10
README.md
10
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);
|
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
|
## Performance
|
||||||
|
|
||||||
Use `EXPLAIN ANALYZE` to debug performance.
|
Use `EXPLAIN ANALYZE` to debug performance.
|
||||||
|
|||||||
Reference in New Issue
Block a user