Quantcast
Channel: Pinecone Community - Latest topics
Viewing all articles
Browse latest Browse all 832

HELP! NOT WORKING: Exclude id & filter id

$
0
0

I am trying to observe the behaviour of exclude_id or filter. However, it seems like the argument is not working at all! it keeps giving me same query result even if i exclude previous query result id in next query (everytime) Can anyone help to see what is going on?

Attached is my query and a screenshot of the output:

import pinecone
from collections import defaultdict

PINECONE_API_KEY = “something that is valid”

PINECONE_ENVIRONMENT = “gcp-starter”

pinecone.init(api_key=PINECONE_API_KEY, environment=PINECONE_ENVIRONMENT)

consumed_id = sorted([
“582c156e-314d-43bc-9cbb-002863af892f”,
“6847af8a-8273-4adb-bddc-1e678cbbe8cc”,
“8bcaf79c-83c5-4efc-b78c-7cc63cb28091”,
“c7577db8-8233-4380-bc40-ddd8a9cf3042”,
“6ef3ee6c-9d6f-48ec-90c8-19f8021ab44c”
])

seen_time = defaultdict(int)

for p in consumed_id:
seen_time[p] += 1

for i in range(10):

get read card data from pinecone

index = pinecone.Index(“iearn-content”)
results = index.query(
vector=vector,
top_k=5,
namespace=“read-card”,
exclude_ids = consumed_id
)

toRead_ids = sorted([result.id for result in results.matches])
print(toRead_ids)

for p in toRead_ids:
seen_time[p] += 1

consumed_id.extend(toRead_ids)
consumed_id = list(set(consumed_id))

5 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 832

Trending Articles