Hello MongoDB Community,I hope this message finds you well. I’m currently working on a project that involves generating vector embeddings for multiple fields within a MongoDB document, and I would like to share my approach and seek your insights.

Generating Vectors for Multiple Fields

In my dataset, each document contains various fields that are crucial for semantic search in a chatbot application. For example, fields like countryName, supplierName, and supplierProductName are all candidates for embedding. My goal is to create embeddings for these fields to improve the chatbot’s ability to understand and respond to user queries effectively.

Can a Pipeline Support Multiple Vector Search Results?

I understand that while it’s possible to index multiple vector embedding fields within a single search index, querying these fields simultaneously can be challenging. Based on my findings, the current limitation is that we can only search one vector field at a time using the $vectorSearch operation. However, I am exploring whether we can combine results from multiple searches using techniques like $unionWith or $lookup.Here are a few points I would like to clarify:

  1. Indexing Multiple Fields: Can anyone confirm that we can indeed create an index that includes multiple vector fields? If so, what best practices should I follow when setting this up?
  2. Querying Multiple Fields: Since we can only search one vector field at a time with $vectorSearch, what would be the most efficient way to handle queries across multiple fields? Would using $unionWith provide the desired results, or is there a more optimal approach?
  3. Future Support: I have heard that there might be plans to support multi-field vector searches in future releases. If anyone has insights into the timeline for this feature or any workarounds in the meantime, I would greatly appreciate it.

Thank you for your time and assistance! I’m looking forward to your suggestions and experiences regarding this topic.Best regards,