# How to Get Newest Relevant Results First

**URL:** <https://community.pinecone.io/t/how-to-get-newest-relevant-results-first/7888>\
**Category:** Support\
**Tags:** semantic-search, vector-database\
**Created:** [April 23, 2025, 1:55pm UTC](https://community.pinecone.io/t/how-to-get-newest-relevant-results-first/7888 "2025-04-23T13:55:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![parthm.optimumbrew](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/parthm.optimumbrew/32/2428_2.png) [@parthm.optimumbrew](https://community.pinecone.io/u/parthm.optimumbrew)\
**Post date:** [April 23, 2025, 1:55pm UTC](https://community.pinecone.io/t/how-to-get-newest-relevant-results-first/7888/1 "2025-04-23T13:55:53Z")

</div>

Hi Pinecone Team,

I’m building a template search system where we store templates in Pinecone using a single vector created from a list of tags. Here’s an example of such a tag list:

```auto

diwali,festival,lights,festivals,deepawali,deepavali,greetings,wish,wishes,card,greeting,design,celebration,dipawali,दीपावली,dewali,deewali,dipavali,दिवाळी,divali,dipawli,wishfully,festivel,featival,dipabali,fastivel,depavali,lighted

```

We use these tags to perform vector searches and successfully get relevant results based on similarity. However, we noticed that **some of the most recent (newest) relevant templates are buried in the middle or end of the results list.**

**What we want:**

We’d like to **sort or prioritize the most relevant AND most recently updated** templates **at the top of the results.** In other words, the newest relevant results should appear first.

* * *

### ⚙ Current Setup:

- We embed tag vectors using `text-embedding-3-large`.

- We use dot product for similarity.

- Detail template information is stored in MySql.

* * *

### 🔍 My Question:

Is there a way in Pinecone to get:

> ✅ Most newest relevant results

If not directly possible, what’s the best practice to **post-process** Pinecone results to achieve this behavior efficiently?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Cory\_Pinecone](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/cory_pinecone/32/1712_2.png) [@Cory\_Pinecone](https://community.pinecone.io/u/Cory_Pinecone)\
**Post date:** [April 28, 2025, 5:38pm UTC](https://community.pinecone.io/t/how-to-get-newest-relevant-results-first/7888/2 "2025-04-28T17:38:11Z")

</div>

Hi @parthm.optimumbrew,

Unfortunately, Pinecone doesn’t have an ‘ORDER BY’ analog. So there’s not a built in way to get the most recent vectors first. But, there is a way you can approximate this.

What you would do is use a timestamp in the metadata of your vectors, ideally an epoch timestamp. This could be for when the vector is created, or when the original source document was created (or both! just use two fields in that case). Then, when searching, you could include a metadata filter that only returns vectors created within the last X days/hours/whatever. Your app could then sort the results by the vectors’ timestamps for ultimate return to the app or user.

Keep in mind that $gte and $lte filter terms can’t operate on date strings, like ‘28 April 2025’. This is why I suggest using epoch times, like 1745798400. Since those are ints they make it easier to filter.
