Hi, I've tried searching, to no avail.
What I want to do is to find documents that contain nested documents, each with different properties, in-order.
E.g. I would like to find documents with nestedthings.myid=nested1 coming before nestedthings.myid=nested2, in the example below this would be document c1 but NOT c2.
NOTE: Eventually the nested documents will be complex documents. Each with perhaps a different schema. But for now they're trivially simple.
PUT span-test/container/c1
{
"myid": "c1",
"nestedthings": [
{
"myid": "nested1"
},
{
"myid": "nested2"
}
]
}
PUT span-test/container/c2
{
"myid": "c2",
"nestedthings": [
{
"myid": "nested2"
},
{
"myid": "nested1"
}
]
}
My understanding is that I want to use a span_near query to accomplish this the most efficiently. But I'm not wed to any particular approach.
NOTE: I'm using nested documents because they exist independently and eventually I'll have multiple properties under each and I want each nested-doc to act as a coherent whole. Anyways with span_near, all of the examples are processing single strings. I can't really serialize my nested documents into strings because of their eventual complexity.
Please help.
I'll reply here with index etc.