Find answers from the community

Updated 2 years ago

Please tell me how to specify filter and

At a glance

The community members are discussing how to specify filters and top_k when using the GPTPineconeIndex.query method. One community member explains that multiple query kwargs can be passed in, such as similarity_top_k, required_keywords, and exclude_keywords. Another community member confirms this is clear.

Additionally, the community members discuss the use of metadata filters in Pinecone, which seem to be a stricter screening method than keywords. One community member asks if they need to use keywords if they want to search for answers from specified files, and another community member suggests using the metadata filters provided by Pinecone.

Useful resources
Please tell me how to specify filter and top_k when using GPTPineconeIndex.query. It seems that only one query_kwargs can be passed in, but the corresponding relationship is not very clear.
L
A
5 comments
More than one query kwargs can be passed in 👍

index.query("my query", similarity_top_k=5, required_keywords=["Italy"], exclude_keywords=["Sky", "Grass])

This will fetch the top_5 closest matching nodes, but ensures they contain the word "Italy" but also excludes "Sky" and "Grass"
clear enough, thanks
In addition, metadata filters is a screening method provided by Pinecone, which seems to be stricter than keywords? If I want to search for answers from some specified files (for example, the subject of the paper), do I have to use keywords?
Ok, thank you very much, I have seen this document, but I didn’t expect it to be defined in the index😋
Add a reply
Sign up and join the conversation on Discord