Repository navigation
Open
Labels
featureFeatureFeaturestatus: blockedWaits for the issues in its Blocked by sectionWaits for the issues in its Blocked by sectiontrack: public sitePages, search, forms and sharingPages, search, forms and sharingv3PromiseTracker v3PromiseTracker v3
Milestone
Description
Type: AFK. Can be built and merged without a decision.
Owner: koechkevin. Order: 9 of 12 for this owner, after #669 and before #657. Track: public site. Build order: #672
Part of PromiseTracker v3, version 1. Specification: docs/spec/promisetracker-v3-system-specification.md. Section numbers below refer to it.
What to build
The payload-search adapter, built on Payload's search plugin (@payloadcms/plugin-search), and
the search page. A search for a place returns everyone who represents it, from the president down.
Section 7.11 describes the design (D44).
Start here
- Read first: sections 7.11, 16.2 and 18 of the specification.
- Code goes in: the
payloadSearchadapter inplugins/core/src/adapters.ts, which is a stub today. The search handler inapps/cms/src/api/v1.ts. The page inapps/site/src/app/(site). - Already there:
unaccentandpg_trgmare installed by the first migration and checked at start-up inapps/cms/src/extensions.ts.@payloadcms/plugin-searchis not in the catalog inpnpm-workspace.yamlyet. - Migration: Yes. The search table and the trigram index.
- How to work:
AGENTS.md, section "Working on an issue".
Acceptance criteria
-
@payloadcms/plugin-searchkeeps asearchcollection in step with claims, actors, areas
and topics, with one entry per language and a localized title - A record is indexed in a language only when it is published in that language.
skipSync
applies the publishing rules in section 8, and a record that leaves the public site leaves
the index - Priorities put areas and actors above claims
-
beforeSyncadds the country, the kind of record and its link, so results need no second
query - The search title has a trigram index, added by migration.
unaccentmakes "Senegal" find
"Sénégal", andpg_trgmmakes a misspelt county still match - Start-up refuses to run if either extension is missing
- An administrator can rebuild the index from the admin with the plugin's reindex action
-
resolvePlacefinds matching areas, then the recursive area query returns every seat above
and below them and their current holders -
/api/v1/search?q=&country=returns places with their representatives first, then actors,
claims and topics -
/{lang}/searchrenders the redesign's search results, linkable by address - Every search is logged with query, language, country and result count, and nothing about
the person - A dashboard widget lists searches that found nothing
- Test: searching the Kenyan fixture for "Nairobi" returns the president, the Nairobi
governor, senator and woman representative, and every MP whose constituency is in Nairobi
Blocked by
- V1-11: Publishing rules and the cascade #649, owned by kelvinkipruto
Unblocks
- V1-22: Security, privacy and retention #660, owned by kelvinkipruto
Metadata
Metadata
Assignees
Labels
featureFeatureFeaturestatus: blockedWaits for the issues in its Blocked by sectionWaits for the issues in its Blocked by sectiontrack: public sitePages, search, forms and sharingPages, search, forms and sharingv3PromiseTracker v3PromiseTracker v3
Activity