Hi there,
I am writing a query for searching a name.
requirements (I have name,first_name, last_name fields that can be searched in type Contact):
- first return match_phrase result if possible
- then return partial matching result whose prefix for each word.
- then return any result that contain the string
e.g. search for "He Mi "
I need a query that will return "He Mi " exact match first if exists.
then return prefix matching for each word like "Helen Mi" "Henry Mike" "Mitchell Henry" etc...
last return single partial word matching result : "He Berry" "Mike C" etc.
my query like below:
GET /crm/Contact/_search
{
"query": {
"wildcard" : { "Name" : "he*mi" }
}
}
but there is no return. However, I should have had result as shown above. How can I deal with it?