Prefix Query Usage

edit

Fluent DSL example

edit
q
.Prefix(c => c
    .Name("named_query")
    .Boost(1.1)
    .Field(p => p.Description)
    .Value("proj")
    .Rewrite(MultiTermQueryRewrite.TopTerms(10))
)

Object Initializer syntax example

edit
new PrefixQuery
{
    Name = "named_query",
    Boost = 1.1,
    Field = "description",
    Value = "proj",
    MultiTermQueryRewrite = MultiTermQueryRewrite.TopTerms(10)
}

Example json output.

{
  "prefix": {
    "description": {
      "_name": "named_query",
      "boost": 1.1,
      "rewrite": "top_terms_10",
      "value": "proj"
    }
  }
}