Partial matching and exact matching in one query

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):

  1. first return match_phrase result if possible
  2. then return partial matching result whose prefix for each word.
  3. 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?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.