Match Phrase Usage

edit

Fluent DSL example

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

Object Initializer syntax example

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

Example json output.

{
  "match_phrase": {
    "description": {
      "_name": "named_query",
      "boost": 1.1,
      "query": "hello world",
      "analyzer": "standard",
      "slop": 2
    }
  }
}