Skip to content

Blocking and Exclusions

Blocking and exclusion rules remove products from search results entirely, ensuring they never appear regardless of relevance or other ranking factors.

Overview

Blocking and exclusions provide hard filters that completely remove products from search results. Use these when products should never appear, regardless of search query or user context.

Use Cases

  • Out of stock: Remove products with zero inventory
  • Policy compliance: Block products that violate policies (age restrictions, regional bans)
  • Quality control: Exclude products with poor quality scores or missing data
  • Legal restrictions: Block products that can't be sold in certain regions
  • Vendor restrictions: Exclude products from specific vendors or suppliers
  • Discontinued items: Remove products that are no longer available

Blocking Types

Product-Level Blocking

Block specific products by ID or SKU:

{
  "type": "block",
  "products": ["prod_123", "prod_456"],
  "reason": "discontinued"
}

Attribute-Based Blocking

Block products matching certain attributes:

{
  "type": "block",
  "condition": {
    "inventory": { "eq": 0 }
  },
  "reason": "out_of_stock"
}

Category-Level Blocking

Block entire categories:

{
  "type": "block",
  "categories": ["discontinued", "recalled"],
  "reason": "policy"
}

Brand-Level Blocking

Block all products from specific brands:

{
  "type": "block",
  "brands": ["brand_x"],
  "reason": "vendor_restriction"
}

Exclusion Rules

Exclusions are similar to blocks but can be more nuanced:

Conditional Exclusions

Exclude products conditionally:

{
  "type": "exclude",
  "condition": {
    "quality_score": { "lt": 0.5 },
    "missing_images": true
  },
  "reason": "low_quality"
}

Query-Specific Exclusions

Exclude products only for specific queries:

{
  "type": "exclude",
  "product_id": "prod_123",
  "queries": ["kids toys"],
  "reason": "age_restriction"
}

Segment-Specific Exclusions

Exclude products for specific customer segments:

{
  "type": "exclude",
  "product_id": "prod_123",
  "segments": ["under_18"],
  "reason": "age_restriction"
}

Regional Exclusions

Block products based on geographic location:

{
  "type": "exclude",
  "product_id": "prod_123",
  "regions": ["EU"],
  "reason": "gdpr_compliance"
}

Inventory-Based Blocking

Automatically block out-of-stock items:

{
  "type": "block",
  "condition": {
    "inventory": { "eq": 0 }
  },
  "reason": "out_of_stock",
  "auto_apply": true
}

Quality-Based Exclusions

Exclude products with quality issues:

{
  "type": "exclude",
  "condition": {
    "or": [
      { "missing_title": true },
      { "missing_images": true },
      { "quality_score": { "lt": 0.3 } }
    ]
  },
  "reason": "data_quality"
}

Temporary Blocks

Block products for a specific time period:

{
  "type": "block",
  "product_id": "prod_123",
  "date_range": {
    "start": "2024-01-01",
    "end": "2024-01-31"
  },
  "reason": "maintenance"
}

Best Practices

  1. Use sparingly: Blocking removes products entirely—ensure it's necessary
  2. Document reasons: Always specify why products are blocked
  3. Monitor impact: Track how blocking affects result counts and user experience
  4. Set up alerts: Get notified when blocking rules remove too many results
  5. Use fallbacks: Combine with fallback strategies to handle low result counts
  6. Review regularly: Periodically review blocked products to ensure they should remain blocked

Fallback Behavior

When blocking removes too many results:

  • Relax rules: Automatically relax blocking rules if result count is too low
  • Show alternatives: Display similar products that aren't blocked
  • Inform users: Show messages explaining why results are limited
  • Boost and Bury - For score adjustments that influence position without removing items
  • Campaign Rules - For time-bound promotions that might include temporary exclusions
  • Compliance Rules - Policy-based blocking and exclusions