Using nodejs ES client to query on two arrays of index associated values

I'm using version 6.11.2 of the nodeJS elasticsearch client in an attempt to access records based on two distinct fields. My query syntax currently looks something like this.

While this yields the records that have a field1 value included in [1,2,3,4] and a field2 value included in [10,11,12,13] is it possible to only return the results that have field1 and field2 values at the same index in the list? (i.e returning results that have field1 = 1 and field2 = 10, field1 = 2 and field2 = 11) and so on? As the code currently stands entries returned have any combination of the two fields included in the array.

My alternative approach would be running many individual queries with single values for field1 and field2 as opposed to arrays. But this prevents me from performing aggregations on the all the desired results. Is there currently a way to do this?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.