Problem/Motivation
#3245497: Not able to select many popular modules improved search for most projects. However, it isn't perfect

We need to make sure exact matches get weighted higher.
Proposed resolution
Add a condition on an exact equals
$query->condition(
(new Condition('OR'))
->condition('title', $string)
->condition('shortname', $string)
);
$title_or_shortname = new Condition('OR');
$title_or_shortname->condition('title', '%' . $this->connection->escapeLike($string) . '%', 'LIKE');
$title_or_shortname->condition('shortname', '%' . $this->connection->escapeLike($string) . '%', 'LIKE');
$query->condition($title_or_shortname);
But this is probably moot since we sort by usage.
Remaining tasks
Review 7.x code & query. Why did they results seem more consistent?
| Comment | File | Size | Author |
|---|---|---|---|
| Screen Shot 2022-04-16 at 8.09.27 AM.png | 626.97 KB | mglaman |
Comments