# Community Search We are planning a new unified search engine for Hub as part of Patner Marketplace feature, however this will take some time to come out as it aims to be a platform component. ## Temporary Community Search To solve the Community Galaxy problem ASAP we come with a plan to provide a imediate solution before rolling out the complete search engine. This is going to be a very basic search endpoint to replace the current search we have in Roles and Collections. ## Unified search for community The proposal is to replace the https://galaxy.ansible.com/ui/search/ with results coming from `api/_ui/v1/search` ```plain GALAXY Login -------------------------------------------------- Search [ nginx ]🔎 >> Filters Type: [collection | role] Tag: [ text ] Platform: [Ubuntu, Fedora, Windows + AWS, Azure...] Deprecated: [True, False] >> Sort Name Namespace Download Count ------------------------------------------------- | Results: 40 - page 1 / 4 | |-----------------------------------------------| | nginx | metadata | collection | | nginx | metadata | role | | nginx | metadata | role | ------------------------------------------------- | | 1, 2, 3, 4, 5, 6 | ------------------------------------------------- ``` ## Implementation - Community galaxy only (endpoint disabled on PAH) - A bare Django APIView with filtering and pagination - No pulp - No RBAC - Combination of 2 querysets as the filtered result ```python roles = LegacyRole.objects.filter(...).annotate(...) collections = Collection.objects.filter(...).annotate(...) result = roles | collections # same as roles.union(collections) result = result.order_by(...) render_as_json(paginated(results)) ``` ## Results Uniform JSON result combining content from both models ```json { "meta": {"count": 40}, "links": {....}, "data": [ {"type": "role", "name": "nginx", ...}, {"type": "collection", "name": "nginx", ...}, ] } ```