Finding time intersections with elasticsearch -


considering following data structure:

{     name: 'track1',     durationsec: 300,     tags: [         {             name: "mike", startsec: 15, endsec: 88         },         {             name: "kate", startsec: 54, endsec: 140         }     ] }, {     name: 'track2',     durationsec: 240,     tags: [         {             name: "mike", startsec: 0, endsec: 150         },         {             name: "kate", startsec: 200, endsec: 220         }     ] 

is possible find tracks example tags "mike" , "kate" have intersections (like above track1 intersection second 54 88) elasticsearch?

it might possible script filter.

you might need access _source , not doc since array values flattened. see more scripting here.

performance won't hoot though, since requires both running script , accessing source. if you're not doing on huge data might reasonable.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -