I'm trying to find the last 30 entries into my index/doc type
I've tried nothing and I'm all out of ideas!
My current approach I find all the results over the last 5 minutes, then filter through the results and grab out the last 30 entries, but this is slower than the correct approach.
s = Search(using=es, index="history", doc_type=p)
.filter('range', timestamp={'gte': mins})
.extra(size=1000)
And I've tried
s = Search(using=es, index="history", doc_type=p)
.sort("timestamp", {'order': "desc"})
.extra(size=30)
s = s.sort({"timestamp" : {"order" : "desc"}})
? – Sonnnie