Complete the code to create a wildcard query that matches any word starting with "test".
{
"query": {
"wildcard": {
"field": [1]
}
}
}The wildcard query uses an asterisk (*) to match any characters after "test".
Complete the code to create a prefix query that matches all words starting with "pre".
{
"query": {
"prefix": {
"field": [1]
}
}
}The prefix query takes the prefix string directly without wildcards.
Fix the error in the wildcard query pattern to match words ending with "ing".
{
"query": {
"wildcard": {
"field": [1]
}
}
}To match words ending with "ing", use the wildcard * before "ing".
Fill both blanks to create a wildcard query matching words containing "cat" anywhere.
{
"query": {
"wildcard": {
"field": [1],
"value": [2]
}
}
}The field is "description" and the wildcard pattern "*cat*" matches "cat" anywhere in the word.
Fill all three blanks to create a prefix query on "name" field with prefix "jo" and boost it by 2.0.
{
"query": {
"prefix": {
[1]: {
"value": [2],
"boost": [3]
}
}
}
}The prefix query uses the field "name", prefix value "jo", and boost 2.0 to increase relevance.