# How to store data in the weaviate vector DB

**URL:** https://forum.weaviate.io/t/how-to-store-data-in-the-weaviate-vector-db/3350
**Category:** Support
**Created:** [August 14, 2024, 5:16pm UTC](https://forum.weaviate.io/t/how-to-store-data-in-the-weaviate-vector-db/3350 "2024-08-14T17:16:15Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![moaabid](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/moaabid/32/1585_2.png) [@moaabid](https://forum.weaviate.io/u/moaabid)
#### Post date: [August 14, 2024, 5:16pm UTC](https://forum.weaviate.io/t/how-to-store-data-in-the-weaviate-vector-db/3350/1 "2024-08-14T17:16:15Z")

</div>

Hi.

I have jewellery dataset around 3000 products. Single product has around 15 images and details. I wanted to do the hybrid search so how to structure it and store the data in the vector DB?.

Have to store each image with same description? or is there a way to group the image and description based on the sku?.

---

<div class="post-metadata">

### Author: ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)
#### Post date: [August 14, 2024, 7:13pm UTC](https://forum.weaviate.io/t/how-to-store-data-in-the-weaviate-vector-db/3350/2 "2024-08-14T19:13:02Z")

</div>

hi @moaabid !!

You could use [multi2vec-clip](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/multi2vec-clip), and define a collection with properties `details`, `image1`, `image2`, …

Here is how using the new python v4 client:

```python
collection = client.collections.create(
    "Jewellery",
    vectorizer_config=wvc.config.Configure.Vectorizer.multi2vec_clip(
        image_fields=[
            wvc.config.Multi2VecField(name="image1", weight=0.3),
            wvc.config.Multi2VecField(name="image2", weight=0.3)
            #...
        ],
        text_fields=[
            wvc.config.Multi2VecField(name="details", float=0.7)
        ]
        
    ),
    properties=[
        wvc.config.Property(name="details", data_type=wvc.config.DataType.TEXT),
        wvc.config.Property(name="image1", data_type=wvc.config.DataType.BLOB),
        wvc.config.Property(name="image2", data_type=wvc.config.DataType.BLOB),
        # ...
    ]
)

```

What will happen “under the hood” is that Weaviate will combine all those vectors into one, taking into account the weights you specified.

Here is where this “magic” take place:

> <https://github.com/weaviate/weaviate/blob/502456b502bbffac6f47e880eb1343662c5be16e/modules/multi2vec-clip/vectorizer/vectorizer.go#L114>

Let me know if this helps!

Thanks!

---

<div class="post-metadata">

### Author: ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)
#### Post date: [August 14, 2024, 7:14pm UTC](https://forum.weaviate.io/t/how-to-store-data-in-the-weaviate-vector-db/3350/3 "2024-08-14T19:14:55Z")

</div>

Regarding the sku, you can use deterministic ids to make sure each product is unique:

> **[Create objects | Weaviate - Vector Database](https://weaviate.io/developers/weaviate/manage-data/create#generate-deterministic-ids)**
>
> The examples on this page demonstrate how to create individual objects in Weaviate.

---

<div class="post-metadata">

### Author: ![moaabid](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/moaabid/32/1585_2.png) [@moaabid](https://forum.weaviate.io/u/moaabid)
#### Post date: [September 25, 2024, 4:54pm UTC](https://forum.weaviate.io/t/how-to-store-data-in-the-weaviate-vector-db/3350/4 "2024-09-25T16:54:15Z")

</div>

@DudaNogueira  
Instead of statically mentioning image1, image2. Is there an array of blob datatype?. Some of the product can have 3 images and other products can have more than that. So it will dynamic.

---

<div class="post-metadata">

### Author: ![moaabid](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/moaabid/32/1585_2.png) [@moaabid](https://forum.weaviate.io/u/moaabid)
#### Post date: [September 26, 2024, 2:24am UTC](https://forum.weaviate.io/t/how-to-store-data-in-the-weaviate-vector-db/3350/5 "2024-09-26T02:24:35Z")

</div>

Example

sku1

- Image1
- Image2  
sku2
- Image1
- Image2
- Image3  
sku3
- Image1
- image2
- image3
- image4

If i store the images individually and i tried to get the response for the input image.

reponse - [{sku1, image1}, {sku2, image1}, {sku1, image2}, {sku3, image4}]

may be sku2 image 1 is closer than the sku1, image2. But i need a response grouping by the sku

response - [{sku1}, {sku2}, {sku3}]

or if there is a way to store multiple images dynamically under one sku. If the input images matches anyone of the image in the array should return the sku. this way the results will have unique data.

Or it has to be handled in the code?. retrieving 50 data and find unique value based on sku

---

<div class="post-metadata">

### Author: ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)
#### Post date: [September 30, 2024, 3:10pm UTC](https://forum.weaviate.io/t/how-to-store-data-in-the-weaviate-vector-db/3350/6 "2024-09-30T15:10:02Z")

</div>

I believe you can try using cross references, so you can have a dynamic number of images to store:

> **[Cross-references | Weaviate](https://weaviate.io/developers/weaviate/manage-data/cross-references)**
>
> Use cross-references to establish directional relationships between collections.

---

<div class="post-metadata">

### Author: ![moaabid](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/moaabid/32/1585_2.png) [@moaabid](https://forum.weaviate.io/u/moaabid)
#### Post date: [October 1, 2024, 3:32am UTC](https://forum.weaviate.io/t/how-to-store-data-in-the-weaviate-vector-db/3350/7 "2024-10-01T03:32:42Z")

</div>

Thanks @DudaNogueira. Actually i wanted to group the result based on sku. There is a group by option in weaviate. Now i’m store the images individually and group it by sku
