0

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

1 Answer 1

2

Yes, you can do range queries in a query_string query like this:

{
    "query": {
        "query_string": {
            "query": "unified_source.*.sizeIncome:>=10"
        }
    }
}
Sign up to request clarification or add additional context in comments.

2 Comments

Thank you. This query looks well, but it leads to jvm heap usage keeps increasing slowly and there is no response for a long time. No responce at all. Strange, beacause I have only 100 documents within that index.
Well, wildcards are rarely a good idea when it comes to performance. but indeed, if you only have 100 documents, that's weird

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.