fpillo
(Fernando Pillo)
November 30, 2017, 8:41pm
1
Hi guys, I know that for execute a "exists" query in a nested type I could use a nested query.
But how about simple Object type?
I am doing this:
{
"from" : 0,
"size" : 10,
"query" : {
"bool" : {
"must" : [
{
"match_all" : {
}
},
{
"exists" : { "field" : "object_type_field" }
}
]
}
}
}
JKhondhu
(Jymit Singh Khondhu)
November 30, 2017, 11:50pm
2
fpillo
(Fernando Pillo)
December 1, 2017, 10:52am
3
No, because the field is not a nested type
"caused_by": {
"type": "illegal_state_exception",
"reason": "[nested] nested object under path [item_availability_hours] is not of nested type"
}
here is the field:
{
"properties": {
"item_availability_hours": {
"properties": {
"FRIDAY": {
"type": "nested",
"properties": {
"end": {
"type": "date",
"format": "hour_minute_second"
},
"start": {
"type": "date",
"format": "hour_minute_second"
}
}
},
"MONDAY": {
"type": "nested",
"properties": {
"end": {
"type": "date",
"format": "hour_minute_second"
},
"start": {
"type": "date",
"format": "hour_minute_second"
}
}
},
"SATURDAY": {
"type": "nested",
"properties": {
"end": {
"type": "date",
"format": "hour_minute_second"
},
"start": {
"type": "date",
"format": "hour_minute_second"
}
}
},
"SUNDAY": {
"type": "nested",
"properties": {
"end": {
"type": "date",
"format": "hour_minute_second"
},
"start": {
"type": "date",
"format": "hour_minute_second"
}
}
},
"THURSDAY": {
"type": "nested",
"properties": {
"end": {
"type": "date",
"format": "hour_minute_second"
},
"start": {
"type": "date",
"format": "hour_minute_second"
}
}
},
"TUESDAY": {
"type": "nested",
"properties": {
"end": {
"type": "date",
"format": "hour_minute_second"
},
"start": {
"type": "date",
"format": "hour_minute_second"
}
}
},
"WEDNESDAY": {
"type": "nested",
"properties": {
"end": {
"type": "date",
"format": "hour_minute_second"
},
"start": {
"type": "date",
"format": "hour_minute_second"
}
}
}
}
}
}
}
system
(system)
Closed
December 29, 2017, 10:52am
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.