# How Elastic search built vector database

**URL:** <https://discuss.elastic.co/t/how-elastic-search-built-vector-database/374076>\
**Category:** Elasticsearch\
**Tags:** vector-search\
**Created:** [February 4, 2025, 6:23pm UTC](https://discuss.elastic.co/t/how-elastic-search-built-vector-database/374076 "2025-02-04T18:23:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sumantapakira](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@sumantapakira](https://discuss.elastic.co/u/sumantapakira)\
**Post date:** [February 4, 2025, 6:23pm UTC](https://discuss.elastic.co/t/how-elastic-search-built-vector-database/374076/1 "2025-02-04T18:23:10Z")

</div>

I would like to study how Vector database is working using Apache Lucene. So for this I am looking into github [GitHub - elastic/elasticsearch: Free and Open Source, Distributed, RESTful Search Engine](https://github.com/elastic/elasticsearch) but could not understand which module is responsible . Could you please guide?

---

<div class="post-metadata">

**Author:** ![BenTrent](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bentrent/32/33915_2.png) [@BenTrent](https://discuss.elastic.co/u/BenTrent)\
**Post date:** [February 4, 2025, 9:20pm UTC](https://discuss.elastic.co/t/how-elastic-search-built-vector-database/374076/2 "2025-02-04T21:20:06Z")

</div>

Do you mean how to use Apache Lucene? Or do you mean how does Apache Lucene store the vectors?

Either way, you should look here: [GitHub - apache/lucene: Apache Lucene open-source search software](https://github.com/apache/lucene)

and here: [Apache Lucene™ 10.1.0 Documentation](https://lucene.apache.org/core/10_1_0/index.html)

Particularly:

- [KnnVectorsFormat (Lucene 10.1.0 core API)](https://lucene.apache.org/core/10_1_0/core/org/apache/lucene/codecs/KnnVectorsFormat.html)
- [KnnFloatVectorQuery (Lucene 10.1.0 core API)](https://lucene.apache.org/core/10_1_0/core/org/apache/lucene/search/KnnFloatVectorQuery.html)
- [KnnFloatVectorField (Lucene 10.1.0 core API)](https://lucene.apache.org/core/10_1_0/core/org/apache/lucene/document/KnnFloatVectorField.html)

---

<div class="post-metadata">

**Author:** ![sumantapakira](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@sumantapakira](https://discuss.elastic.co/u/sumantapakira)\
**Post date:** [February 4, 2025, 9:41pm UTC](https://discuss.elastic.co/t/how-elastic-search-built-vector-database/374076/3 "2025-02-04T21:41:43Z")

</div>

Thanks for taking your time.  
I saw the Apache Lucene Github project. Something is clear there but not everything clear still and I am exploring this.  
Meanwhile, I wanted to understand how Elastic search has integrated Vector search functionality of Apache Lucene and overcome the problem of high dimension.  
And for this I would like to see code example of Elastic search that shows integration with Apache Lucene 🙂  
I started looking into Elastic search Git repo but could not figure out which where its written. will be great If you could point me the correct place.

---

<div class="post-metadata">

**Author:** ![BenTrent](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bentrent/32/33915_2.png) [@BenTrent](https://discuss.elastic.co/u/BenTrent)\
**Post date:** [February 4, 2025, 10:24pm UTC](https://discuss.elastic.co/t/how-elastic-search-built-vector-database/374076/4 "2025-02-04T22:24:52Z")

</div>

The DenseVectorFieldMapper class is likely what you want.

> <https://github.com/elastic/elasticsearch/blob/main/server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java>

---

<div class="post-metadata">

**Author:** ![sumantapakira](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@sumantapakira](https://discuss.elastic.co/u/sumantapakira)\
**Post date:** [February 5, 2025, 1:01pm UTC](https://discuss.elastic.co/t/how-elastic-search-built-vector-database/374076/5 "2025-02-05T13:01:16Z")

</div>

Many thanks!
