From e683506bc5ff513b969c00f05bfd8bd60dd433ab Mon Sep 17 00:00:00 2001 From: izapata Date: Thu, 12 Feb 2026 17:58:49 +0100 Subject: [PATCH] feat: add tst_elastic_seach.py for Elasticsearch integration with Ollama --- scratches/izapata/tst_elastic_seach.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 scratches/izapata/tst_elastic_seach.py diff --git a/scratches/izapata/tst_elastic_seach.py b/scratches/izapata/tst_elastic_seach.py new file mode 100644 index 0000000..3a08c45 --- /dev/null +++ b/scratches/izapata/tst_elastic_seach.py @@ -0,0 +1,19 @@ +from langchain_elasticsearch import ElasticsearchStore +from langchain_community.llms import Ollama +from langchain_community.embeddings import OllamaEmbeddings + +es_url = "http://localhost:9200" + +base_url = "http://ollama-light-service:11434" +model_name = "qwen2.5:1.5b" + +print(f"Starting server") + +llm = Ollama(base_url=base_url, model=model_name) +embeddings = OllamaEmbeddings(base_url=base_url, model="nomic-embed-text") + + +vector_store = ElasticsearchStore( + es_url=es_url, index_name="avap_manuals", embedding=embeddings +) +print(vector_store)