diff --git a/docs/Query/Prefix.md b/docs/Query/Prefix.md new file mode 100644 index 0000000000000000000000000000000000000000..32cda5971f31a33722dabad25e9bc3a20875b302 --- /dev/null +++ b/docs/Query/Prefix.md @@ -0,0 +1,26 @@ +# Prefix Query + +> More info about prefix query is in the [official elasticsearch docs][1] + +Matches documents that have fields containing terms with a specified prefix. + +## Simple example + +```JSON +{ + "prefix" : { "user" : "ki" } +} +``` + +In DSL: + +```php +$prefixQuery = new PrefixQuery('user', 'ki'); + +$search = new Search(); +$search->addQuery($prefixQuery); + +$queryArray = $search->toArray(); +``` + +[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-prefix-query.html