# How to create multiple dense vector field?

**URL:** <https://discuss.elastic.co/t/how-to-create-multiple-dense-vector-field/320514>\
**Category:** Elasticsearch\
**Tags:** vector-search\
**Created:** [December 6, 2022, 2:58am UTC](https://discuss.elastic.co/t/how-to-create-multiple-dense-vector-field/320514 "2022-12-06T02:58:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sungwon1110](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sungwon1110/32/114260_2.png) [@sungwon1110](https://discuss.elastic.co/u/sungwon1110)\
**Post date:** [December 6, 2022, 2:58am UTC](https://discuss.elastic.co/t/how-to-create-multiple-dense-vector-field/320514/1 "2022-12-06T02:58:53Z")

</div>

Im trying to create multiple dense vector field.  
This is my mapping code:  
{

"mappings": {  
"properties": {  
"ABSTRACT\_vector": {  
"type": "dense\_vector",  
"dims": 384  
},  
"BACKGROUND\_vector": {  
"type": "dense\_vector",  
"dims": 384  
},  
"METHODS\_vector": {  
"type": "dense\_vector",  
"dims": 384  
},  
"RESULTS\_vector": {  
"type": "dense\_vector",  
"dims": 384  
},  
"CONCLUSIONS\_vector": {  
"type": "dense\_vector",  
"dims": 384  
},

However, Elasticsearch only creates one dense vector field, and the other dense vector field changed to float field automatically. How can I create multiple dense vector field?

---

<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:** [December 8, 2022, 12:24pm UTC](https://discuss.elastic.co/t/how-to-create-multiple-dense-vector-field/320514/2 "2022-12-08T12:24:35Z")

</div>

I just tested this and it worked fine. What version of Elasticsearch are you using and what exactly are you seeing in the results?

I used `dims: 4` just to simplify testing. It still works with higher dims.

```auto
{
  "mappings": {
    "properties": {
      "ABSTRACT_vector": {
        "type": "dense_vector",
        "dims": 4
      },
      "BACKGROUND_vector": {
        "type": "dense_vector",
        "dims": 4
      },
      "METHODS_vector": {
        "type": "dense_vector",
        "dims": 4
      },
      "RESULTS_vector": {
        "type": "dense_vector",
        "dims": 4
      },
      "CONCLUSIONS_vector": {
        "type": "dense_vector",
        "dims": 4
      }
    }
  }
}

```

```auto
POST multi_vectors/_doc
{
  "ABSTRACT_vector": [1, 2, 3, 4],
  "BACKGROUND_vector": [1, 2, 3, 4],
  "METHODS_vector": [1, 2, 3, 4],
  "RESULTS_vector": [1, 2, 3, 4],
  "CONCLUSIONS_vector": [1, 2, 3, 4]
}

```

^ And the mapping is still correct and searching worked just fine.

Here is my mapping result:

```auto
{
  "multi_vectors": {
    "aliases": {},
    "mappings": {
      "properties": {
        "ABSTRACT_vector": {
          "type": "dense_vector",
          "dims": 4
        },
        "BACKGROUND_vector": {
          "type": "dense_vector",
          "dims": 4
        },
        "CONCLUSIONS_vector": {
          "type": "dense_vector",
          "dims": 4
        },
        "METHODS_vector": {
          "type": "dense_vector",
          "dims": 4
        },
        "RESULTS_vector": {
          "type": "dense_vector",
          "dims": 4
        }
      }
    },
   ///settings...
  }
}

```

---

<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:** [January 5, 2023, 12:25pm UTC](https://discuss.elastic.co/t/how-to-create-multiple-dense-vector-field/320514/3 "2023-01-05T12:25:06Z")

</div>

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