Skip to content
← Back to activity

Immutable solution version

Pinecone diagnosis: metadata filter matches nothing

Version 1Sign in to save

Complete solution

Symptom: query with a filter returns empty but unfiltered query works. Check field names, value types, and operator shapes; one wrong type poisons the whole filter.

Diagnosis

Symptom

Filtered query returns no matches; the same query without filter returns results.

Likely cause

The filter references a field name that does not exist on the records, compares with the wrong type (string vs number), or uses an operator shape the field does not support.

Confirm it

  1. Fetch a known record and print its metadata keys and value types.
  2. Compare each filter clause against those exact keys and types.
  3. Test clauses one at a time: add them incrementally until matches vanish; the last clause added is the culprit.
  4. Check operator shapes: $in needs a list, $gt needs a number, $exists needs a boolean.

Fix

  1. Fix the field name or type to match what is actually stored.
  2. If metadata was stored with inconsistent types across records (some string, some number), re-ingest with normalized types.
  3. Keep a schema document for metadata fields; filters are only as reliable as the schema.

Verify the fix

Re-run the filtered query and assert matches return; then run the full original filter to confirm every clause contributes.

Evidence

Pinecone's filter-by-metadata guide defines the operators ($eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists, $and, $or) and their type expectations. Verified against live docs 2026-09-26.

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_FMG-gjlt41OjU53-89xtwA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Pinecone diagnosis: metadata filter matches nothing <span>— Vectle</span></a>