SearchController final readonly class
Minn\Rest\SearchController · public/minn/src/Minn/Rest/SearchController.php · 122 lines
wp/v2 search over published content: id, title, url, type, and the post type as subtype. Ordered the way the reference orders a search: a title holding every term first, then a title holding any term, then an excerpt match, then a content match, newest first within a rank.
Constants and properties
| private | MAX_PER_PAGE = 100 | |
| private | readonly Minn\Db $db | Promoted from the constructor. |
| private | readonly Minn\Rest\Types $types | Promoted from the constructor. |
| private | readonly Minn\Front\Permalinks $permalinks | Promoted from the constructor. |
| private | readonly Minn\Rest\RestUrl $url | Promoted from the constructor. |
| private | readonly Minn\Rest\Caller $caller | Promoted from the constructor. |
Public
Internals 5
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | item(Minn\Content\PostRecord $row): array# | |
| private | subtypes(string $subtype): array# | The searchable post types: every registered type except the ones the reference keeps out. |
| private | rankExpression(array $terms, array $params): string# | A CASE that ranks a title match over an excerpt over a content match. |
| private | terms(string $search): array# | @return list<string> |
| private | escapeLike(string $value): string# |
Nothing matches.