Reputation: 115
I have a simple range query:
{
"query": {
"range": {
"unified_source.step_11.sizeIncome": {
"gte" : 10
}
}
}
}
But I need to apply this query to all nested objects, like this:
{
"query": {
"range": {
"unified_source.*.sizeIncome": {
"gte" : 10
}
}
}
}
This returns no hits.
Is that possible to use some wildcard there?
Can I 'combine' that query with Query String Query somehow? (In Query String wildcard can be used to search "within" specific inner elements of the document).
Thanks
Upvotes: 0
Views: 1097
Reputation: 217294
Yes, you can do range queries in a query_string query like this:
{
"query": {
"query_string": {
"query": "unified_source.*.sizeIncome:>=10"
}
}
}
Upvotes: 2