# Natural language query to Elasticsearch query conversion

**URL:** <https://discuss.huggingface.co/t/natural-language-query-to-elasticsearch-query-conversion/103441>\
**Category:** Beginners\
**Created:** [August 22, 2024, 5:30am UTC](https://discuss.huggingface.co/t/natural-language-query-to-elasticsearch-query-conversion/103441 "2024-08-22T05:30:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![souvik1712das](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@souvik1712das](https://discuss.huggingface.co/u/souvik1712das)\
**Post date:** [August 22, 2024, 5:30am UTC](https://discuss.huggingface.co/t/natural-language-query-to-elasticsearch-query-conversion/103441/1 "2024-08-22T05:30:46Z")

</div>

I have been working on a POC to build a Python code that converts natural language query to elasticsearch query DSL using an open-source LLM model.

Hi Folks,

I tried with text generation models like `facebook/bart-large`, `gpt2` but didn’t get the desired result. But when I use the same prompt in ChatGPT or Gemini, it provides the expected response.

Is there any open-source LLM I can use that would be the best fit for this solution?

Kind regards,  
Souvik
