IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Query Usage
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Query Usage
editThe query element within the search request body allows to define a query using the Query DSL.
Fluent DSL example
edits => s
.Query(q => q
.Term(p => p.Name, "elasticsearch")
)
Object Initializer syntax example
editnew SearchRequest<Project>
{
Query = new TermQuery
{
Field = "name",
Value = "elasticsearch"
}
}
Example json output.
{
"query": {
"term": {
"name": {
"value": "elasticsearch"
}
}
}
}