> For the complete documentation index, see [llms.txt](https://docs.flowiseai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowiseai.com/integrations/langchain/vector-stores/elastic.md).

# Elastic

## Prerequisite

1. You can use the [official Docker image](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html) to get started, or you can use [Elastic Cloud](https://www.elastic.co/cloud/), Elastic's official cloud service. In this guide, we will be using cloud version.
2. [Register](https://cloud.elastic.co/registration) an account or [login](https://cloud.elastic.co/login) with existing account on Elastic cloud.

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-be5fe37be0932b3466423f8e3daf616880b44d8d%2Felastic1.png?alt=media" alt=""><figcaption></figcaption></figure>

3. Click **Create deployment**. Then, name your deployment, and choose the provider.

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-1e5620411a0e05d31547cc193cc3481b03b15488%2Felastic2.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

4. After deployment is finished, you should be able to see the setup guides as shown below. Click the **Set up vector search** option.

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-7af0ed03b704692deccc35d4f19cec1d1ade26e0%2Felastic4.png?alt=media" alt=""><figcaption></figcaption></figure>

5. You should now see the **Getting started** page for **Vector Search**.

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-5c56ee8fc5be340caf04e2ede6bdd7f8015e737a%2Felastic5.png?alt=media" alt=""><figcaption></figcaption></figure>

6. On the left hand side bar, click **Indices**. Then, **Create a new index**.

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-8cf14213820705cbe6e50b2c6223d853dd57c0a8%2Felastic6.png?alt=media" alt=""><figcaption></figcaption></figure>

7. Select **API** ingestion method

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-e5a960b9382e347ca74a0c9e185a90ddf90205f9%2Felastic7.png?alt=media" alt=""><figcaption></figcaption></figure>

8. Name your search index name, then **Create Index**

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-e6a04e8a6b184b6ec785f4d90d92c6e2383b2fe7%2Felastic8.png?alt=media" alt=""><figcaption></figcaption></figure>

9. After the index has been created, generate a new API key, take note of both generated API key and the URL

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-25533262698aff05f53691d19e7a599fa3f2ab40%2Felastic9.png?alt=media" alt=""><figcaption></figcaption></figure>

## Flowise Setup

1. Add a new **Elasticsearch** node on canvas and fill in the **Index Name**

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-8ffc19b47dc38e0c6e7106cb66c28efa0502c748%2Felastic10.png?alt=media" alt="" width="275"><figcaption></figcaption></figure>

2. Add new credential via **Elasticsearch API**

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-06307d7cc2a9ba26fb796588f133c08699256789%2Felastic11.png?alt=media" alt="" width="429"><figcaption></figcaption></figure>

3. Take the URL and API Key from Elasticsearch, fill in the fields

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-546f772f5f694c4a539ff69b2291317d3833f2ba%2Felastic12.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

4. After credential has been created successfully, you can start upserting the data

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-acf1b3186a1930d1611f473f7daf2ebd0df99482%2FUntitled%20(1)%20(1)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-3ed8b9b30693f02369385f4cba392180e9f59d0e%2Felastic13.png?alt=media" alt=""><figcaption></figcaption></figure>

5. After data has been upserted successfully, you can verify it from Elastic dashboard:

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-98d15ed201009d833c6d6a3aeb10cfa7a825276c%2Fimage%20(7)%20(1)%20(1)%20(1)%20(1)%20(1)%20(2)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

6. Voila! You can now start asking question in the chat

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-9c59d54699a5b9db6b208ed6b6be8e242bc7e079%2Fimage%20(6)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(2)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

## Resources

* [LangChain JS Elastic](https://js.langchain.com/docs/integrations/vectorstores/elasticsearch)
* [Vector Search (kNN) Implementation Guide - API Edition](https://www.elastic.co/search-labs/blog/articles/vector-search-implementation-guide-api-edition)
