Match Phrase Prefix Usage

edit

Fluent DSL example

edit
q
.MatchPhrasePrefix(c => c
    .Field(p => p.Description)
    .Analyzer("standard")
    .Boost(1.1)
    .Query("hello worl")
    .MaxExpansions(2)
    .Slop(2)
    .Name("named_query")
)

Object Initializer syntax example

edit
new MatchPhrasePrefixQuery
{
    Field = Field<Project>(p => p.Description),
    Analyzer = "standard",
    Boost = 1.1,
    Name = "named_query",
    Query = "hello worl",
    MaxExpansions = 2,
    Slop = 2
}

Example json output.

{
  "match_phrase_prefix": {
    "description": {
      "_name": "named_query",
      "boost": 1.1,
      "query": "hello worl",
      "analyzer": "standard",
      "max_expansions": 2,
      "slop": 2
    }
  }
}