Hi, with reference to this Multiple Vector Embeddings in one document? we can generate vector embeddings for the multiple fields but can we query on multiple fields as well, I mean finding search results on the basis of multiple vector embedded fields?
@Aasawari
Hi @Noman_Saleem -
You can index multiple vector embedding fields within a single search index as that example you linked shows, but you can only search these fields one at a time.
If you wanted to combine the results of multiple searches. you would have to do this with a $unionWith or $lookup
Clarifying here that this is not currently supported within $vectorSearch as noted in the limitations section of the $vectorSearch documentation. We are actively working on a solution for this, so it should be supported not too far in the future.
You can use $search with the knnBeta operator in the meantime to achieve this functionality.
Hi, is this feature already available, basically our use case is we will have
- Multiple embedding fields(let’s use just 2 for example)
- metadata fields
And we will have a variety of query types, for example:
- use the 2 embeddings for the search but give a higher weight/importance to one of them so it influences the search results more.
- the same as previous example but add some filters based on metadata(such as year)
- similar to previous 2 but use in combination with lexicon search(use the embedding but also text search giving more weight to the vector search than the text search)
Sorry if this question is a dumb question, I’m a complete newbie to mongodb
Hi @Luis_Leal!
This is not at all a dumb question, and I’m glad that you asked it.
Multiple vector fields within a vectorSearch type index are supported for the exact reason you’ve described, and we are in the process of updating our docs to make the usage patterns clearer. The antiicpated query pattern is to use this in concert with $unionWith to join two result sets using the weighted scores of each’s ordinals. This is the same method by which you might expect to combine vector search results with lexical search results, as we’ve documented in a tutorial here.
What I will also say is that we think that this syntax could be made much easier to use, and will be having more updates on this in the near future (which I will make sure to post on this thread ).
Hopefully that answers your question, and I hope you’ve been having a positive experience with the service so far.