| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 | [[query-dsl-prefix-query]]=== Prefix QueryMatches documents that have fields containing terms with a specifiedprefix (*not analyzed*). The prefix query maps to Lucene `PrefixQuery`.The following matches documents where the user field contains a termthat starts with `ki`:[source,js]--------------------------------------------------GET /_search{ "query": {    "prefix" : { "user" : "ki" }  }}--------------------------------------------------// CONSOLEA boost can also be associated with the query:[source,js]--------------------------------------------------GET /_search{ "query": {    "prefix" : { "user" :  { "value" : "ki", "boost" : 2.0 } }  }}--------------------------------------------------// CONSOLEOr with the `prefix` deprecated[5.0.0, Use `value`] syntax:[source,js]--------------------------------------------------GET /_search{ "query": {    "prefix" : { "user" :  { "prefix" : "ki", "boost" : 2.0 } }  }}--------------------------------------------------// CONSOLE// TEST[warning:Deprecated field [prefix] used, expected [value] instead]This multi term query allows you to control how it gets rewritten using the<<query-dsl-multi-term-rewrite,rewrite>>parameter.
 |