Boosting Edge Ngrams Not Working


#1

I am seeking help to write a query for ES 1.6 that boosts documents that have been indexed using ngrams. My documents looks something like the following:

        {
           "lastName": "Garcia",
           "firstName": "Juan"
        }

I would like for people to be able to type "Garc" in my application, find people whose last name begins with "Garc", and have those people show up at the top of the search results. I have configured my index to use ngrams by following the suggestions at the URL below:

Index-Time Search-as-You-Type: https://www.elastic.co/guide/en/elasticsearch/guide/current/_index_time_search_as_you_type.html

Using the what I learned from the Elasticsearch guide, I have written a query to search for documents that is similar to what I have pasted below.

GET /my_index/my_type/_search
{
  "query": {
    "match": {
      "lastName": {
        "query": "garc",
        "boost": 5
      }
    }
  }
}

Reference: https://www.elastic.co/guide/en/elasticsearch/guide/current/_boosting_query_clauses.html

All of the documents in the query's search results have a relevance score of 1. I am expecting at least some of the documents to have a relevance score of 5. What am I missing? What issues have I overlooked?


(system) #2