I am trying to fetch all matching sentences from a blob of text using nested datatype of Elasticsearch. In the query mentioned below, I try to filter all the sentence which have "the" and "of" mentioned in the same sentence.
GET myindex/doc/_search
{
"from": 0,
"size": 1,
"query": {
"nested": {
"path": "parent.data",
"query": {
"bool": {
"filter": [
{
"match": {
"parent.data.sentence": "the"
}
},
{
"match": {
"parent.data.sentence": "of"
}
}
]
}
},
"inner_hits": {}
}
}
}
Although the response shows, added below, that there are 544 documents in total, only three of them are shown by ES. How can I get to retrieve all of them?
{
"took": 709,
"timed_out": false,
"_shards": {
"total": 6,
"successful": 6,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 73783,
"max_score": 0,
"hits": [
{
"_index": "my-index",
"_type": "doc",
"_id": "bd9e3c03741956db68fd692a6914e811b0749baaf6565c6385380919f1ce3932",
"_score": 0,
"_source": {},
"inner_hits": {
"parent.data.sentence": {
"hits": {
"total": 544,
"max_score": 0,
"hits": [<response containing 3 sentence>],
}
}
}
]
}
}