$records =
[ ['id' =>
$recordA, 'name' => 'match', 'shortCode' => 'test', 'countryId' =>
$country],
['id' =>
$recordB, 'name' => 'not', 'shortCode' => 'match 1', 'countryId' =>
$country],
];
$this->repository->
create($records, Context::
createDefaultContext());
$criteria =
new Criteria();
$builder =
$this->
getContainer()->
get(EntityScoreQueryBuilder::
class);
$pattern =
$this->
getContainer()->
get(SearchTermInterpreter::
class)->
interpret('match'
);
$context = Context::
createDefaultContext();
$queries =
$builder->
buildScoreQueries( $pattern,
$this->repository->
getDefinition(),
$this->repository->
getDefinition()->
getEntityName(),
$context );
$criteria->
addQuery(...
$queries);
$result =
$this->repository->
searchIds($criteria, Context::
createDefaultContext());