chore: Formatting

Signed-off-by: Anush008 <anushshetty90@gmail.com>
This commit is contained in:
Anush008
2025-06-07 00:03:39 +05:30
parent 8127784ffe
commit 9f98a1ee89
+25 -20
View File
@@ -40,12 +40,13 @@ One of the most exciting features of the new node is seamless hybrid search: com
<iframe width="560" height="315" src="https://www.youtube.com/embed/sYP_kHWptHY?si=t4GTxVCfTNiXEE4S" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> <iframe width="560" height="315" src="https://www.youtube.com/embed/sYP_kHWptHY?si=t4GTxVCfTNiXEE4S" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
Here’s a quick walkthrough: Here’s a quick walkthrough:
1\. Create a Hybrid Collection
1. Create a Hybrid Collection
* Use Qdrant Cloud’s free tier for experimentation. * Use Qdrant Cloud’s free tier for experimentation.
* Create a collection that supports both dense (semantic) and sparse (lexical) vectors. For example: * Create a collection that supports both dense (semantic) and sparse (lexical) vectors. For example:
json ```json
{ {
"semantic": { "semantic": {
"size": 4, "size": 4,
@@ -53,60 +54,64 @@ json
}, },
"lexical": {} "lexical": {}
} }
```
Dense vectors are for semantic search; sparse vectors handle keyword searches. The sparse vector configuration is simple—just specify the name, as the size is dynamic. Dense vectors are for semantic search; sparse vectors handle keyword searches. The sparse vector configuration is simple—just specify the name, as the size is dynamic.
2\. Insert Data Points 2. Insert Data Points
* Insert points with both dense and sparse vectors. Here’s a sample payload: * Insert points with both dense and sparse vectors. Here’s a sample payload:
json ```json
\[ [
{ {
"id": "209ed309-bb5e-47fd-8af6-a54eea28e0e7", "id": "209ed309-bb5e-47fd-8af6-a54eea28e0e7",
"payload": {}, "payload": {},
"vector": { "vector": {
"semantic": \[0.3, 0.1, 0.4, 0.2\], "semantic": [0.3, 0.1, 0.4, 0.2],
"lexical": {"indices":\[1, 2\], "values": \[0.2, \-0.5\]} "lexical": {"indices":[1, 2], "values": [0.2, -0.5]}
} }
}, },
{ {
"id": "f7e8316e-91da-4b97-9ae9-7503e6cdbd7b", "id": "f7e8316e-91da-4b97-9ae9-7503e6cdbd7b",
"payload": {}, "payload": {},
"vector": { "vector": {
"semantic": \[0.4, 0.0, \-0.4, 0.2\], "semantic": [0.4, 0.0, -0.4, 0.2],
"lexical": {"indices":\[54\], "values": \[\-0.9\]} "lexical": {"indices":[54], "values": \[-0.9]}
} }
} }
\] ]
```
Batch upserts are now supported natively, making large-scale data ingestion fast and simple. Batch upserts are now supported natively, making large-scale data ingestion fast and simple.
3\. Run a Hybrid Search 3. Run a Hybrid Search
* Use the query\_points operation to perform hybrid searches. For example: * Use the query_points operation to perform hybrid searches. For example:
json ```json
\[ [
{ {
"query": \[0.0, 0.6, 0.7, 0.9\], "query": [0.0, 0.6, 0.7, 0.9],
"using": "semantic", "using": "semantic",
"limit": 2 "limit": 2
}, },
{ {
"query": { "query": {
"indices": \[55, 2\], "indices": [55, 2],
"values": \[0.6, 0.7\] "values": [0.6, 0.7]
}, },
"using": "lexical", "using": "lexical",
"limit": 2 "limit": 2
} }
\] ]
```
* Merge results using reciprocal rank fusion (RRF): * Merge results using reciprocal rank fusion (RRF):
json ```json
{"fusion": "rrf"} {"fusion": "rrf"}
```
This approach retrieves top results from both semantic and lexical searches and fuses them, delivering more relevant outcomes,especially for complex, domain-specific queries. This approach retrieves top results from both semantic and lexical searches and fuses them, delivering more relevant outcomes,especially for complex, domain-specific queries.
@@ -116,7 +121,7 @@ The Qdrant node for n8n is just the beginning. You can now build advanced RAG ch
We welcome your feedback, suggestions, and contributions on GitHub! Don’t forget to star the repo and join our Discord community if you have questions or want to connect with other users. We welcome your feedback, suggestions, and contributions on GitHub! Don’t forget to star the repo and join our Discord community if you have questions or want to connect with other users.
## Resources: ## Resources
* [Qdrant n8n Node on npm](https://www.npmjs.com/package/n8n-nodes-qdrant) * [Qdrant n8n Node on npm](https://www.npmjs.com/package/n8n-nodes-qdrant)
* [GitHub Repo](https://github.com/qdrant/n8n-nodes-qdrant) * [GitHub Repo](https://github.com/qdrant/n8n-nodes-qdrant)