# Using Elasticsearch for full-text search on a specific column with ScyllaDB - performance

**URL:** https://forum.scylladb.com/t/using-elasticsearch-for-full-text-search-on-a-specific-column-with-scylladb-performance/4501
**Category:** ScyllaDB
**Tags:** data-model, performance, elasticsearch
**Created:** [February 16, 2025, 4:41am UTC](https://forum.scylladb.com/t/using-elasticsearch-for-full-text-search-on-a-specific-column-with-scylladb-performance/4501 "2025-02-16T04:41:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Guy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/guy/32/9_2.png) [@Guy](https://forum.scylladb.com/u/Guy)
#### Post date: [February 16, 2025, 4:41am UTC](https://forum.scylladb.com/t/using-elasticsearch-for-full-text-search-on-a-specific-column-with-scylladb-performance/4501/1 "2025-02-16T04:41:10Z")

</div>

> [@](#):
>
> [**Originally from the User Slack**](https://scylladb-users.slack.com/)
> 
> ![Ahmed](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/2X/8/8c77489910df3d18876aa0561e0e72f53f13548f.png) **@Ahmed:** We’ve set up Elasticsearch for full-text search on a specific column. The challenge is retrieving full records from ScyllaDB in bulk. After finding results in Elasticsearch, querying ScyllaDB with multiple keys using the `IN` operator requires `ALLOW FILTERING` and doesn’t use the secondary index. Searching one by one is too slow. Is there a better way to fetch bulk data efficiently from ScyllaDB based on Elasticsearch results?
> 
> ![avi](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/1X/b5e08becda8d9df1abff1d3a2d9ffe1126ac3fc6.jpeg) **@avi:** You should store the primary key in Elasticsearch along with the column you’re indexing
> 
> ![Ahmed](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/2X/8/8c77489910df3d18876aa0561e0e72f53f13548f.png) **@Ahmed:** Even with the primary key stored in Elasticsearch, retrieving thousands of records from ScyllaDB is still challenging due to the need for multiple queries.
> 
> ![avi](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/1X/b5e08becda8d9df1abff1d3a2d9ffe1126ac3fc6.jpeg) **@avi:** If you fire them off in parallel (not using IN) the entire cluster bandwidth can be utilized.
> 
> ![Ahmed](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/2X/8/8c77489910df3d18876aa0561e0e72f53f13548f.png) **@Ahmed:** that’s what i’m doing right now using multiple threads to query prepared statement it’s work but i was looking for proper solution
> 
> ![avi](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/1X/b5e08becda8d9df1abff1d3a2d9ffe1126ac3fc6.jpeg) **@avi:** Launching thousands of threads will be slow, better to use async
> 
> ![Ahmed](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/2X/8/8c77489910df3d18876aa0561e0e72f53f13548f.png) **@Ahmed:** i’m using threadpool and like 10 max threads
> 
> ![avi](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/1X/b5e08becda8d9df1abff1d3a2d9ffe1126ac3fc6.jpeg) **@avi:** That’s not enough for thousands of keys. Better to use async.
> 
> ![Ahmed](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/2X/8/8c77489910df3d18876aa0561e0e72f53f13548f.png) **@Ahmed:** thanks it’s works great
