I can use simple wildcard query like this:
"wildcard" : { "user" : "ki*y" }
but if i want to use wildcard in field, then what? How shoud look valid query for this:
"wildcard" : { "base/*" : "value" }
Wildcards are special characters that can stand in for unknown characters in a text value and are handy for locating multiple items with similar, but not identical data. Wildcards can also help with getting data based on a specified pattern match.
To use wildcard characters in a query, the enableQuerySyntax option of the Querybox component must be enabled.
A wildcard operator is a placeholder that matches one or more characters. For example, the * wildcard operator matches zero or more characters. You can combine wildcard operators with other characters to create a wildcard pattern.
You can use query_string which allows both field names wildcards and query text wildcards.
Something around these lines:
{
"query": {
"query_string": {
"fields": [
"base*"
],
"query": "ki*y"
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With