By default the simple_query_string
query doesn't analyze the words with wildcards. As a result it searches for all tokens that start with i-ma
. The word i-mac
doesn't match this request because during analysis it's split into two tokens i
and mac
and neither of these tokens starts with i-ma
. In order to make this query find i-mac
you need to make it analyze wildcards:
{
"_source":true,
"query":{
"simple_query_string":{
"query":"i-ma*",
"analyze_wildcard": true,
"default_operator":"AND"
}
}
}
Igor