> ## Documentation Index
> Fetch the complete documentation index at: https://actianvectorai-docs-low-effort-fixes.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Filter with should conditions

> Apply OR logic to match at least one condition.

Should filters match results where at least one condition is true. Use should filters to broaden search scope while maintaining control over result types, such as searching across multiple categories.

<Note>
  This page uses a `products` collection with 128-dimensional vectors and payload fields: `category` (string) and `price` (float).
</Note>

<CodeGroup>
  ```python Python theme={null}
  from actian_vectorai import VectorAIClient, FilterBuilder, Field
  import random

  # Connect to VectorAI DB server
  with VectorAIClient("localhost:6574") as client:
      # Generate query vector
      query_vector = [random.gauss(0, 1) for _ in range(128)]
      
      # Filter: category should be electronics OR books OR clothing
      filter = FilterBuilder()\
          .should(Field("category").eq("electronics"))\
          .should(Field("category").eq("books"))\
          .should(Field("category").eq("clothing"))\
          .build()
      
      # Search with filter
      results = client.points.search(
          "products",  # Collection name
          vector=query_vector,  # Query vector
          limit=10,  # Maximum results
          filter=filter  # Apply filter
      )
      
      # Display results
      for result in results:
          print(f"ID: {result.id}")
          print(f"Category: {result.payload['category']}")
          print(f"Price: ${result.payload['price']}")
          print("-" * 50)
  ```

  ```javascript JavaScript theme={null}
  import { VectorAIClient, FilterBuilder, Field } from '@actian/vectorai-client';

  async function main() {
      // Connect to VectorAI DB server
      const client = new VectorAIClient('localhost:6574');

      // Generate query vector
      const queryVector = Array.from({ length: 128 }, () => Math.random() * 2 - 1);

      // Filter: category should be electronics OR books OR clothing
      const filter = new FilterBuilder()
          .should(new Field('category').eq('electronics'))
          .should(new Field('category').eq('books'))
          .should(new Field('category').eq('clothing'))
          .build();

      // Search with filter
      const results = await client.points.search('products', queryVector, {
          filter: filter,
          limit: 10
      });

      // Display results
      for (const result of results) {
          console.log(`ID: ${result.id}`);
          console.log(`Category: ${result.payload.category}`);
          console.log(`Price: $${result.payload.price}`);
          console.log('-'.repeat(50));
      }
  }

  main().catch(console.error);
  ```
</CodeGroup>

Each result includes these fields:

* `id`: The unique identifier of the matching point.
* `score`: Similarity score based on vector distance.
* `payload`: Full metadata dictionary for the matching point.
