Guide To Vectors
  • Introduction
  • Guide to this Book
  • API documentation
  • Python SDK Documentation
  • Learn about vectors
    • 🌱Introduction to vectors
      • 🌱Applications of vectors
        • 🌱Vectors for classification
      • 🌱Limitations of vectors
    • 🌱What is vector search?
      • 🌱How to vector search
      • 🌱How to build image to text search using code
      • 🧍Try vector search with playground!
      • 💻Vector search with code
    • 🌱Terminology Guide
  • Unlock Vector AI
    • 🔍Inserting Into Vector AI
      • 🧍Inserting with playground
      • 💻Inserting with API
        • 💻Inserting with API - encoding while inserting (recommended)
        • 💻Inserting with API - encoding before inserting
        • 💻Inserting with API - encoding after inserting
      • 🧍How to check insertion succeeded
    • 🔍Searching with Vector AI
      • 🌱How to search with the playground
      • 🌱Combining with traditional search
        • 🧍How to combine exact text search with vector search
        • 💻How to add exact text search to vector search
      • 🌱Personalisation with vector search
        • 💻Personalised search/recommendations with vector search
      • 🌱Chunk search
        • 💻How To Chunk Search
        • 💻How To Do MultiVector Chunk Search
        • 💻How to do multi step chunk search
      • 🧍How to diversify search results
    • 🔍Clustering
      • 🌱Clustering Vectors From Deep Learning models
    • 🔍Aggregation
      • 💻Writing Your First Aggregation
      • 💻Publishing Your First Aggregation
    • 🔍Experimentation
      • 🌱Vector Evaluation
        • 🌱Evaluate Vector Bias
    • 🔍Jobs
      • 💻Tagging Jobs
      • 💻Chunking Jobs
      • 💻Encoding Jobs
      • 🧍List all jobs (active and inactive)
    • 🔍Encoding
    • 🔍Maintenance & Monitoring
      • 🧍How to view your collections
      • 💻How to share your collections
      • 💻How to back up your collections
      • 💻How to change name of a collection field
      • 💻How to change the schema of a collection
      • 💻How to remove a field in a collection
      • 💻How to request a read API key
  • Tutorials
    • 💻How to turn data into Vectors (code)
      • 💻How to turn text into Vectors
      • 💻How to turn images Into Vectors
      • 💻How to turn audio into Vectors
    • 💻Image Search For Developers
    • 💻How To Combine Different Vectors For Search
    • 💻How To Combine Different Vectors With Exact Matching Text
    • 💻Semantic NLP search with FAISS and VectorHub
  • ABOUT
    • Credits
    • Philosophy
    • Glossary
Powered by GitBook
On this page

Was this helpful?

  1. Tutorials

How To Combine Different Vectors For Search

Searching across multiple vectors is easy with Vector AI!

Required Knowledge: Vectors, Encoding, Vector Search Audience: Data scientists, Vector enthusiasts, Statisticians, Machine learning engineers Reading time: 3 minutes

When we are searching, sometimes we may want to combine multiple vectors. Constructing the multivector query can be quite difficult at first so here, so here we show the idea behind these different types of multivector queries.

from vectorai import ViClient 
vi = ViClient()
multivector_query = {
    "semantic_search": {"vector": vector_1, "field": {"bert_vector_": 0.3}},
    "bag_of_word_search": {"vector": vector_2, "field": {"bow_vector_": 0.7}}
}
vi.advanced_search(
    collection_name=collection_name,
    multivector_query=multivector_query)

Breaking down the multivector query

The semantic_search and bag_of_word_search are aliases of the multivector query. These can be used to improve readability of the different search query constructions.

In the advanced search query, there are 2 required fields. vector and field. The vector field contains the vector and the field field contains an object where the key is the vector field and the value has the weight.

The advanced_search_query is designed to provide a flexible way to search collections. This can be helpful to provide a number of ways combine vector spaces if you want to combine the multilingual specialties of one vector space with the slang specialties of another vector space.

PreviousImage Search For DevelopersNextHow To Combine Different Vectors With Exact Matching Text

Last updated 4 years ago

Was this helpful?

💻