1
0
Fork 0

Only return search matches once, fixes #1801

pull/1807/head
Jordi Boggiano 2013-04-15 18:56:40 +02:00
parent 1e94e8ca5e
commit 3a612dca01
1 changed files with 4 additions and 3 deletions

View File

@ -83,10 +83,11 @@ class ArrayRepository implements RepositoryInterface
$matches = array();
foreach ($this->getPackages() as $package) {
$name = $package->getName();
// TODO implement SEARCH_FULLTEXT handling with keywords/description matching
if (preg_match($regex, $package->getName())) {
$matches[] = array(
'name' => $package->getName(),
if (!isset($matches[$name]) && preg_match($regex, $name)) {
$matches[$name] = array(
'name' => $package->getPrettyName(),
'description' => $package->getDescription(),
);
}