一键导入
minoo-search
Use when working on Minoo search, autocomplete, or NorthCloud search integration in src/Search/ or SearchServiceProvider
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when working on Minoo search, autocomplete, or NorthCloud search integration in src/Search/ or SearchServiceProvider
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when working on Minoo HTTP controllers, routing, or request handling in src/Http/Controller/ (or src/Http/Middleware/) or route definitions in src/Provider/
Use when working on Minoo entity types, access policies, service providers, or seed data in src/ or tests/Minoo/
Use when working on Minoo templates, CSS design system, or SSR rendering in templates/, public/css/, or src/Controller/ render methods
Use when working on Minoo ingestion pipeline, mappers, materializer, or ingest logs in src/Ingestion/ or tests relating to ingestion
| name | minoo:search |
| description | Use when working on Minoo search, autocomplete, or NorthCloud search integration in src/Search/ or SearchServiceProvider |
Files: src/Search/, src/Provider/SearchServiceProvider.php
Tests: tests/Minoo/Unit/Search/
Minoo delegates search to NorthCloud — no local indexing. Two clients handle different search needs:
final class NorthCloudSearchProvider implements SearchProviderInterface
{
public function __construct(
string $baseUrl,
int $timeout = 15,
int $cacheTtl = 60,
?callable $httpClient = null, // injectable for testing
);
public function search(SearchRequest $request): SearchResult;
}
URL construction:
GET {baseUrl}/api/v1/search?q={query}&page={page}&page_size={pageSize}
&include_facets=1&include_highlights=1
&content_type={filter} // optional
&min_quality_score={score} // optional
&topics[]={topic} // array params with bracket notation
&source_names[]={source} // array params with bracket notation
Response model:
SearchResult: totalHits, totalPages, currentPage, pageSize, tookMs, hits[], facets[]SearchHit: id, title, url, sourceName, crawledAt, qualityScore, contentType, topics[], score, ogImage, highlightSearchFacet: name, buckets[] (key + count)body[0], falls back to raw_text[0], then title[0]Caching: In-memory TTL cache keyed by SearchRequest::cacheKey(). Duplicate requests within TTL skip HTTP.
Error handling: HTTP failures return SearchResult::empty() — graceful degradation, never throws.
final class CommunityAutocompleteClient
{
public function suggest(string $query, int $limit = 10): array;
// Returns: [{id, name, community_type, province}, ...]
// Endpoint: GET {baseUrl}/api/communities/search?q={query}&page_size={limit}
}
Same caching and error handling pattern as search provider.
SearchServiceProvider:
register(): Creates NorthCloudSearchProvider, binds to SearchProviderInterface singletonboot(): Registers SearchTwigExtension — adds search(q, {content_type, source}, page) Twig functionConfiguration (config/waaseyaa.php):
'search' => [
'base_url' => env('NORTHCLOUD_SEARCH_URL', 'https://northcloud.one'),
'timeout' => env('NORTHCLOUD_SEARCH_TIMEOUT', 15),
'cache_ttl' => env('NORTHCLOUD_SEARCH_CACHE_TTL', 60),
'base_topics' => ['indigenous'], // always included, overrides user filters
],
Injectable httpClient callable for deterministic tests:
$provider = new NorthCloudSearchProvider(
baseUrl: 'https://example.com',
httpClient: fn(string $url): string|false => json_encode($fixture),
);
Key test scenarios:
httpClient returns false → SearchResult::empty()topics%5B%5D= (bracket encoding)base_topics: Config base_topics are always prepended — don't duplicate in requesttopics[]=value not topics=value<em> tags — templates must use |raw filterdocs/specs/search.md — full search architecture, facet types, config referencewaaseyaa_get_spec api-layer — routing, controller wiring