Lets say I have 3 documents
- Doc A
- Doc B
- Doc C
and each document is versioned by timeStamp. The Documents will follow this schema:
id: uniqueID
title: DocA, DocB, DocC, etc...
timeStamp: date
documentContents: text
How would I query in a way such that I query only the latest document (defined by timestamp) for each unique title?
So I might want documents which contain the word "dog" but DocA and DocB might have it in multiple versions. The query will return every version of DocA and DocB which contains "dog".
I only want the search result to return only the latest versions of DocA and DocB.