NOTE: You are looking at documentation for an older release. For the latest information, see the current release documentation.
Simple Query String Usage
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Simple Query String Usage
editFluent DSL example
editq .SimpleQueryString(c => c .Name("named_query") .Boost(1.1) .Fields(f => f.Field(p => p.Description).Field("myOtherField")) .Query("hello world") .Analyzer("standard") .DefaultOperator(Operator.Or) .Flags(SimpleQueryStringFlags.And | SimpleQueryStringFlags.Near) .Lenient() .AnalyzeWildcard() .MinimumShouldMatch("30%") )
Object Initializer syntax example
editnew SimpleQueryStringQuery { Name = "named_query", Boost = 1.1, Fields = Field<Project>(p => p.Description).And("myOtherField"), Query = "hello world", Analyzer = "standard", DefaultOperator = Operator.Or, Flags = SimpleQueryStringFlags.And | SimpleQueryStringFlags.Near, Lenient = true, AnalyzeWildcard = true, MinimumShouldMatch = "30%" }
Example json output.
{ "simple_query_string": { "_name": "named_query", "boost": 1.1, "fields": [ "description", "myOtherField" ], "query": "hello world", "analyzer": "standard", "default_operator": "or", "flags": "AND|NEAR", "lenient": true, "analyze_wildcard": true, "minimum_should_match": "30%" } }
Was this helpful?
Thank you for your feedback.