# ElasticSearch Quality Inside PostgreSQL? ParadeDB Introduces pg\_bm25

**URL:** https://forum.djangoproject.com/t/elasticsearch-quality-inside-postgresql-paradedb-introduces-pg-bm25/24654
**Category:** Using the ORM
**Created:** [October 19, 2023, 3:30pm UTC](https://forum.djangoproject.com/t/elasticsearch-quality-inside-postgresql-paradedb-introduces-pg-bm25/24654 "2023-10-19T15:30:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![FlipperPA](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/flipperpa/32/181_2.png) [@FlipperPA](https://forum.djangoproject.com/u/FlipperPA)
#### Post date: [October 19, 2023, 3:30pm UTC](https://forum.djangoproject.com/t/elasticsearch-quality-inside-postgresql-paradedb-introduces-pg-bm25/24654/1 "2023-10-19T15:30:34Z")

</div>

ParadeDB introduced a PostgreSQL extension promising ElasticSearch quality results within PostgreSQL. It looks pretty impressive and is built on top of Tantivy, a Rust-based alternative to Apache’s Lucene.

> **[pg\_bm25: Elastic-Quality Full Text Search Inside Postgres - ParadeDB](https://docs.paradedb.com/blog/introducing_bm25)**

As someone who has run into the limitations and bugs present in PostgreSQL’s TS\_VECTOR search, this looks incredibly promising… and perhaps an extension to Django’s ORM could be in order. My team is going to test this with a multi-TB dataset to see how it performs. Here are some of the key takeaways:

- 100% Postgres native, with zero dependencies on an external search engine
- Built on top of Tantivy, a Rust-based alternative to the Apache Lucene search library
- Query times over 1M rows are 20x faster compared to `tsquery` and `ts_rank`, Postgres’ built-in full-text search and sort functions
- Support for fuzzy search, aggregations, highlighting, and relevance tuning
- Relevance scoring uses BM25, the same algorithm used by ElasticSearch
- Real-time search — new data is immediately searchable without manual reindexing

Having the syntax in line with SQL looks fantastic too:

```auto
SELECT *
FROM my_table
WHERE my_table @@@ '"my query string"'

SELECT *
FROM my_table
WHERE my_table @@@ 'description:keyboard^2 OR electronics:::fuzzy_fields=description&distance=2'

```

Has anyone else played with this yet?

---

<div class="post-metadata">

### Author: ![pauloxnet](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/pauloxnet/32/11021_2.png) [@pauloxnet](https://forum.djangoproject.com/u/pauloxnet)
#### Post date: [October 20, 2023, 11:49am UTC](https://forum.djangoproject.com/t/elasticsearch-quality-inside-postgresql-paradedb-introduces-pg-bm25/24654/2 "2023-10-20T11:49:20Z")

</div>

I would definitely play with it in the next weeks.  
Thanks for your post.

---

<div class="post-metadata">

### Author: ![adamchainz](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/adamchainz/32/26_2.png) [@adamchainz](https://forum.djangoproject.com/u/adamchainz)
#### Post date: [October 20, 2023, 11:55am UTC](https://forum.djangoproject.com/t/elasticsearch-quality-inside-postgresql-paradedb-introduces-pg-bm25/24654/3 "2023-10-20T11:55:58Z")

</div>

Thanks for sharing, looks very interesting.

---

<div class="post-metadata">

### Author: ![philippemnoel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/philippemnoel/32/17346_2.png) [@philippemnoel](https://forum.djangoproject.com/u/philippemnoel)
#### Post date: [November 25, 2023, 9:05pm UTC](https://forum.djangoproject.com/t/elasticsearch-quality-inside-postgresql-paradedb-introduces-pg-bm25/24654/4 "2023-11-25T21:05:36Z")

</div>

Hello! I’m of the makers of ParadeDB. It’s super cool to see our work be featured on the Django forum. If you have any thoughts/feedback as you play with it, please let us know. Django and Postgres are a terrific combination for any developer and we’re committed to making pg\_bm25 and ParadeDB something truly magical for the Django community. 🙂
