# Dense\_vector type changes to “float” after loading the data

**URL:** <https://discuss.elastic.co/t/dense-vector-type-changes-to-float-after-loading-the-data/350309>\
**Category:** Elasticsearch\
**Tags:** vector-search\
**Created:** [January 3, 2024, 1:43pm UTC](https://discuss.elastic.co/t/dense-vector-type-changes-to-float-after-loading-the-data/350309 "2024-01-03T13:43:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rakesh\_Kalange](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakesh_kalange/32/130007_2.png) [@Rakesh\_Kalange](https://discuss.elastic.co/u/Rakesh_Kalange)\
**Post date:** [January 3, 2024, 1:43pm UTC](https://discuss.elastic.co/t/dense-vector-type-changes-to-float-after-loading-the-data/350309/1 "2024-01-03T13:43:14Z")

</div>

Hi,  
I'm trying to load vector\_value into Elasticsearch,  
index creation and data loading finished without any error.  
But the result of mapping shows type "float", not "dense\_vector".  
The version of Elasticsearch is 7.4.3.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 3, 2024, 1:47pm UTC](https://discuss.elastic.co/t/dense-vector-type-changes-to-float-after-loading-the-data/350309/2 "2024-01-03T13:47:02Z")

</div>

You need to specify the mapping through an index template or when you create the index. Dense vector fileds will not be identified as such through dynamic mapping.

> [@Rakesh\_Kalange](#):
>
> The version of Elasticsearch is 7.4.3.

This is very old and has been EOL a long time. A lot of improvements have been made in the vector area so I would recommend up upgrade to the latest version as a matter of urgency.

---

<div class="post-metadata">

**Author:** ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)\
**Post date:** [January 3, 2024, 3:35pm UTC](https://discuss.elastic.co/t/dense-vector-type-changes-to-float-after-loading-the-data/350309/3 "2024-01-03T15:35:40Z")

</div>

FYI, newer versions of Elasticsearch (8.11.0+) will dynamically map [dense vector](https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html) fields for float arrays of sizes \>= 128. Earlier versions do have to have explicit mappings.

---

<div class="post-metadata">

**Author:** ![Rakesh\_Kalange](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakesh_kalange/32/130007_2.png) [@Rakesh\_Kalange](https://discuss.elastic.co/u/Rakesh_Kalange)\
**Post date:** [January 11, 2024, 9:15am UTC](https://discuss.elastic.co/t/dense-vector-type-changes-to-float-after-loading-the-data/350309/4 "2024-01-11T09:15:12Z")

</div>

> [@Christian\_Dahlqvist](#):
>
> You need to specify the mapping through an index template or when you create the index.

Yes we do provide mapping when we create the index; still in some cases it maps them as float vector.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 11, 2024, 9:55am UTC](https://discuss.elastic.co/t/dense-vector-type-changes-to-float-after-loading-the-data/350309/5 "2024-01-11T09:55:12Z")

</div>

Are you providing the mappings through an index template so you are sire they are applied before data is added?

---

<div class="post-metadata">

**Author:** ![Rakesh\_Kalange](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakesh_kalange/32/130007_2.png) [@Rakesh\_Kalange](https://discuss.elastic.co/u/Rakesh_Kalange)\
**Post date:** [January 29, 2024, 12:40pm UTC](https://discuss.elastic.co/t/dense-vector-type-changes-to-float-after-loading-the-data/350309/6 "2024-01-29T12:40:53Z")

</div>

Yes, mappings are provided using an index template and are applied before indexing the data. We saw this is happening only in one of the environment. rest other environments are working fine.

Deleting and recreating index fixed this issue but would like to know what can cause this type of issue and what is the recommended way to prevent it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 26, 2024, 12:41pm UTC](https://discuss.elastic.co/t/dense-vector-type-changes-to-float-after-loading-the-data/350309/7 "2024-02-26T12:41:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
