Hi,
Elasticsearch 5.1 data structure:
"test123": {
"mappings": {
"doctype1": {
"dynamic": "strict",
"_parent": {
"type": "doctype2"
},
"_routing": {
"required": true
},
"properties": {
"title": {
"type": "text"
}
}
},
"doctype2": {...},
"doctype3": {
"dynamic": "strict",
"_parent": {
"type": "doctype1"
},
"_routing": {
"required": true
},
"properties": {
"start_datetime": {
"type": "date"
}
}
}
}
}
Any idea why the last query returns only 18 hits? (should return 474 because everything in doctype3 has start_datetime = datetime.datetime(2017, 2, 14, 6, 39, 36, 989408)).
Query on http://localhost:9200/test123/doctype1/_search - result: 474
{
"_source":{
"includes":[
"title"
]
},
"query":{
"match_all":{
}
}
}
Query on http://localhost:9200/test123/doctype1/_search - result: 474
{
"_source":{
"includes":[
"title"
]
},
"query":{
"bool":{
"filter":[
{
"has_child":{
"type":"doctype3"
}
}
]
}
}
}
Query on http://localhost:9200/test123/doctype3/_search - result: 2495
{
"_source":{
"includes":[
"start_datetime"
]
},
"query":{
"bool":{
"filter":[
{
"range":{
"start_datetime":{
"lte":"2017-02-15",
"gte":"2017-02-13"
}
}
}
]
}
}
}
Query on http://localhost:9200/test123/doctype1/_search - result: 18, why?
{
"_source":{
"includes":[
"_id",
"title"
]
},
"query":{
"bool":{
"filter":[
{
"has_child":{
"type":"doctype3",
"query":{
"range":{
"start_datetime":{
"gte":"2017-02-13",
"lte":"2017-02-15"
}
}
}
}
}
]
}
}
}
Maybe the query is incorrect?