diff --git a/docs/Query/SimpleQueryString.md b/docs/Query/SimpleQueryString.md new file mode 100644 index 0000000000000000000000000000000000000000..8f21ded57f9f5534ecab2db2bb5707f7dc5c1b7b --- /dev/null +++ b/docs/Query/SimpleQueryString.md @@ -0,0 +1,38 @@ +# Simple Query String Query + +> More info about simple query string query is in the [official elasticsearch docs][1] + +A query that uses the SimpleQueryParser to parse its context + +## Simple example + +```JSON +{ + "simple_query_string" : { + "query": "\"fried eggs\" +(eggplant | potato) -frittata", + "analyzer": "snowball", + "fields": ["body^5","_all"], + "default_operator": "and" + } +} +``` + +In DSL: + +```php +$simpleQueryStringQuery = new SimpleQueryStringQuery( + '"fried eggs" +(eggplant | potato) -frittata', + [ + 'analyzer' => 'snowball', + 'fields' => ['body^5', '_all'], + 'default_operator' => 'and', + ] +); + +$search = new Search(); +$search->addQuery($simpleQueryStringQuery); + +$queryArray = $search->toArray(); +``` + +[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html