# Is there a default threshold while querying?

**URL:** <https://community.pinecone.io/t/is-there-a-default-threshold-while-querying/6184>\
**Category:** General\
**Tags:** vector-database, embeddings\
**Created:** [July 19, 2024, 10:28am UTC](https://community.pinecone.io/t/is-there-a-default-threshold-while-querying/6184 "2024-07-19T10:28:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![siddharth](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/siddharth/32/2941_2.png) [@siddharth](https://community.pinecone.io/u/siddharth)\
**Post date:** [July 19, 2024, 10:28am UTC](https://community.pinecone.io/t/is-there-a-default-threshold-while-querying/6184/1 "2024-07-19T10:28:05Z")

</div>

Let’s say I am searching within 30 vectors, based on a metadata filter, and I gave an embedding for getting the top 5 most similar matches, but I am not getting any results. Is there a threshold which is in place by default?

---

<div class="post-metadata">

**Author:** ![ZacharyProser](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/zacharyproser/32/1146_2.png) [@ZacharyProser](https://community.pinecone.io/u/ZacharyProser)\
**Post date:** [July 19, 2024, 1:19pm UTC](https://community.pinecone.io/t/is-there-a-default-threshold-while-querying/6184/2 "2024-07-19T13:19:54Z")

</div>

Hi @siddharth, and welcome to the Pinecone community forums!

Thank you for your question.

There’s no default threshold, but as [our Query Data guide](https://docs.pinecone.io/guides/data/query-data#querying-by-vector) explains,

> Depending on your data and your query, you may get fewer than `top_k` results. This happens when `top_k` is larger than the number of possible matching vectors for your query.

Could you share more about:

1. Your data - what you’re indexing
2. How you’re querying it

and any relevant code you have? If you do share your code, please be careful not to include any secrets such as your Pinecone API key.

That would help us debug further.

Hope this helps!

Best,  
Zack

---

<div class="post-metadata">

**Author:** ![siddharth](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/siddharth/32/2941_2.png) [@siddharth](https://community.pinecone.io/u/siddharth)\
**Post date:** [July 19, 2024, 11:59pm UTC](https://community.pinecone.io/t/is-there-a-default-threshold-while-querying/6184/3 "2024-07-19T23:59:41Z")

</div>

The pinecone\_index has around 350,000 vectors, out of which the filter passes around 40 files here. The data is from a custom model which gets 64 dimensional vectors from any audio file. So, I am querying with 1 vector embedding(for an audio) to find a closes match within the rest of the 40 audio files(or vectors)

Here is the code I have -

```auto
        compatible_vectors = pinecone_index.query(
            vector=vector_embedding,
            top_k=5,
            include_metadata=True,
            filter={
                "$and": [
                    {"field1": field1_filter},
                    {"filename": {"$in": list_of_filenames}},
                ]
            },
        )

```

My question mainly is two parts -

1. Shouldn’t pinecone at least return the closest matches anyway, since I can get the cosine distances between the vector\_embedding above and the rest of the 40 embeddings?
2. Can anything be done from the user side to mitigate this?

---

<div class="post-metadata">

**Author:** ![zeke](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/zeke/32/4257_2.png) [@zeke](https://community.pinecone.io/u/zeke)\
**Post date:** [July 23, 2024, 4:21pm UTC](https://community.pinecone.io/t/is-there-a-default-threshold-while-querying/6184/4 "2024-07-23T16:21:13Z")

</div>

@siddharth We recently experienced an incident during which some queries returned no results. Are you still experiencing this behavior now? If so, can you please share the name of the index in question?
