Can I use spannear in the nested field for different block in elasticsearch?
问题 The document is like: doc = { "id": 1, "content": [ { "txt": I, "time": 0, }, { "txt": have bla bla, "time": 1, }, { "txt": bla bla book, "time": 2, }, { "txt": do not match this block, "time": 3, }, ] } And the search query is like: "span_near": { "clauses": [ {"span_term": {"content.txt": "I"}}, {"span_term": {"content.txt": "book"}}, ], "slop": 5, "in_order": False, } And I want to return "content.time": [0,1,2] Now, I know by using the nested field, the "content.time" can be retrieved,