Skip to content
Snippets Groups Projects
Commit 3902dd30 authored by Aivaras Gotovskis's avatar Aivaras Gotovskis
Browse files

Add simple query string query doc.

parent f8c742ae
No related branches found
No related tags found
No related merge requests found
# 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment