I’m encountering an issue when querying my Pinecone index with a metadata filter intended to exclude a specific record. Despite applying the $ne
filter on the opportunity_id
field in the metadata, the record with the excluded opportunity_id
still appears in the query results.
Query Setup:
query_response = index.query(
id=semantic_vector_record_id,
top_k=10,
include_metadata=True,
filter={"opportunity_id": {"$ne": semantic_vector_record_id}}
)
Metadata Structure Example:
Here’s an example of the metadata for one of the records in the index
{
"opportunity_id": "bBvlrCoafmqbicUnTVSc",
"original_text": "We are seeking to publish Match-3 puzzle games targeted for the mobile platform across Europe. We are looking for developers who are interested in partnering with a publisher to expand their game's reach and performance in the European market."
}
Issue:
The record with opportunity_id: "bBvlrCoafmqbicUnTVSc"
is still being included in the query results even though the filter explicitly excludes it.
Expected Behavior:
The query results should exclude any record with opportunity_id matching the value specified in the $ne filter.
Actual Behavior:
The record with the excluded opportunity_id is still returned in the query results.