Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.

Prefix Query

More info about prefix query is in the official elasticsearch docs

Matches documents that have fields containing terms with a specified prefix.

Simple example

{
    "prefix" : { "user" : "ki" }
}

In DSL:

$prefixQuery = new PrefixQuery('user', 'ki');

$search = new Search();
$search->addQuery($prefixQuery);

$queryArray = $search->toArray();