# Natural language query to Elasticsearch query conversion

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fnatural-language-query-to-elasticsearch-query-conversion%2F103441%3E%5C
**Category:** Beginners\
**Created:** [August 22, 2024, 5:30am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fnatural-language-query-to-elasticsearch-query-conversion%2F103441 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsouvik1712das)%5C
**Post date:** [August 22, 2024, 5:30am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fnatural-language-query-to-elasticsearch-query-conversion%2F103441%2F1 "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
