WARNING: Version 5.x has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Simple Query String Usage
editSimple 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) .Locale("en_US") .LowercaseExpendedTerms() .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, Locale = "en_US", LowercaseExpendedTerms = true, 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", "locale": "en_US", "lowercase_expanded_terms": true, "lenient": true, "analyze_wildcard": true, "minimum_should_match": "30%" } }