Time-based searches near a certain timestamp


(jat850) #1

i am trying to perform a search where I have an array of terms (serial numbers) and I would like to get at least one (but preferably only the first) document containing that serial number after a given timeframe.

So as an example, I have 5 serial numbers and I'd like to get the first entry for each serial number on that date. I'd like to get only one for each serial number (JUST the first).

I could take the trivial approach and get all documents within a known large time range and then pare it down but it may be a lot (also, it may vary greatly) and I would like to strongly limit my result set.

Is something like this possible? I apologize in advance because I am very new to ElasticSearch and still learning my way around queries.


(system) #2