Skip to content

7. Filtering and Metadata

Estimated time: 10 minutes

Learn how to use filtering and attach metadata to your vectors.

Steps

  1. Add metadata to vectors:
  2. Use the add method with metadata if supported.
  3. Filter during search:
  4. Use filter parameters to restrict search results.

Example

# Example assumes filtering API is available
results = index.search(query, k=5, filter={"category": "A"})

Next: Debugging and Troubleshooting