|
1 | 1 | DESCRIPTION > |
2 | | - - `search_collections_projects_repos.pipe` serves the unified search widget for collections, projects, and repositories. |
3 | | - - Performs search across three entity types using shared `search` parameter and returns up to configurable results per type. |
4 | | - - Combines results from `collections_filtered`, `insightsProjects_filtered`, and `activityRepositories_filtered` pipes. |
| 2 | + - `search_collections_projects_repos.pipe` serves the unified search widget for collections, projects, repositories, and organizations. |
| 3 | + - Performs search across four entity types using shared `search` parameter and returns up to configurable results per type. |
| 4 | + - Combines results from `collections_filtered`, `insightsProjects_filtered`, `activityRepositories_filtered`, and `organizations_filtered` pipes. |
5 | 5 | - Filters out inactive projects (with 0 organizations and 0 contributors) to ensure relevant search results. |
6 | | - - Orders results by relevance: collections by project count, projects by contributor count, repositories alphabetically. |
| 6 | + - Orders results by relevance: collections by project count, projects by contributor count, repositories alphabetically, organizations by contribution count. |
7 | 7 | - Primary use case: powering global search functionality and autocomplete dropdowns across the platform. |
8 | 8 | - Parameters: |
9 | 9 | - `search`: Required string for searching across all entity types (inherited by filtered pipes) |
10 | 10 | - `limit`: Optional integer for result limit per entity type, defaults to 10 |
11 | | - - Response: `type` ('collection'|'project'|'repository'), `id` (projectId only), `slug`, `logo`, `projectSlug`, `name` |
| 11 | + - Response: `type` ('collection'|'project'|'repository'|'organization'), `id` (projectId only), `slug`, `logo`, `projectSlug`, `name` |
12 | 12 |
|
13 | 13 | NODE merge_results_from_collections_projects_repos_filtered |
14 | 14 | SQL > |
|
53 | 53 | from activityRepositories_filtered |
54 | 54 | order by activityRepositories_filtered.repo asc |
55 | 55 | limit {{ Integer(limit, 10, description="Limit number of records for each type", required=False) }} |
| 56 | + union all |
| 57 | + select |
| 58 | + 'organization' as type, |
| 59 | + organizations_filtered.id, |
| 60 | + organizations_filtered.slug, |
| 61 | + organizations_filtered.logo, |
| 62 | + null as "projectSlug", |
| 63 | + organizations_filtered.displayName as name, |
| 64 | + '' as status |
| 65 | + from organizations_filtered |
| 66 | + order by organizations_filtered.contributionCount desc |
| 67 | + limit {{ Integer(limit, 10, description="Limit number of records for each type", required=False) }} |
0 commit comments