# Hybrid search with embedding outside the database

**URL:** <https://forum.weaviate.io/t/hybrid-search-with-embedding-outside-the-database/4171>\
**Category:** Support\
**Created:** [September 16, 2024, 11:10am UTC](https://forum.weaviate.io/t/hybrid-search-with-embedding-outside-the-database/4171 "2024-09-16T11:10:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LauraZ](https://avatars.discourse-cdn.com/v4/letter/l/e47774/32.png) [@LauraZ](https://forum.weaviate.io/u/LauraZ)\
**Post date:** [September 16, 2024, 11:10am UTC](https://forum.weaviate.io/t/hybrid-search-with-embedding-outside-the-database/4171/1 "2024-09-16T11:10:52Z")

</div>

Morning

I have a question related to hybrid search. We are testing weaviate locally and doing the embedding out of the database, and pass it the vector to insert and query data. But, because of this, If I fill query parameter in the following code, it raises an error because the database can´t embed the query so I don´t know how I can pass the “keyword” part to the hybrid search

```auto
            results = self.collection.query.hybrid(query=None,# No se puede pasar str pq falla al intentar hacer el embedding en la BD y no está configurado
                                                   vector=vector,
                                                   return_metadata=weaviate.classes.query.MetadataQuery(distance=True,score=True, explain_score=True),
                                                   alpha=alpha,
                                                   limit=top_k)

```

After reading the forum, I have understood that the sparse vector is obtained inside the database. Is any configuration needed? How could we pass the text for the database to obtain the sparse vector in the hybrid search?

Thanks a lot for your help!

- Weaviate Server Version:
- Deployment Method: 
- Multi Node? Number of Running Nodes:
- Client Language and Version:
- Multitenancy?:

### Any additional Information

---

<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 16, 2024, 8:40pm UTC](https://forum.weaviate.io/t/hybrid-search-with-embedding-outside-the-database/4171/2 "2024-09-16T20:40:59Z")

</div>

hi @LauraZ !!

The hybrid search is a fusion of the keyword search and the vector search.

When you provide the `vector` parameter, Weaviate will not vectorize the query for you. The `query` parameter will be used only for the keyword search phase.

If you do not provide the `vector` parameter, then Weaviate will vectorize it for you, considering you have a working vectorizer configured.

Check here for more information on that:

> **[Hybrid search | Weaviate](https://weaviate.io/developers/weaviate/search/hybrid#specify-a-search-vector)**
>
> Hybrid search combines the results of a vector search and a keyword (BM25F) search by fusing the two result sets.

Let me know if this helps.

Thanks!
