Add wiki comments to Advanced search
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Problem to solve
Comments on wikis was merged in Feat: wiki top level discussions (!171764 - merged)
Folks will want to search for comments on wikis. Comment search is very valuable when you are trying to find important discussions you had that may not have been written into an issue/MR description.
Proposal
Index wiki comments in Advanced search and allow them to be searchable alongside all other comments. This will will need to be split up into multiple MRs.
Note: These steps will need to change if a few issues are completed (specifically #462686 and #351376 (closed))
- Add new fields to the notes index. New fields should be
namespace_id(long),wiki_access_level(short)
- Add new fields to
Elastic::Latest::NoteInstanceProxy#as_indexed_json - Add new fields to the mappings in
Elastic::Latest::NoteConfig - Add add advanced search migration to add the new fields to the index
- Backfill the missing wiki comments into the Notes index using an Advanced search migration
- Update
Elastic::Latest::NoteClassProxyso that it queries these documents -
TODO: Need to confirm if Group wiki notes are indexed or not. I found a comment in
ee/lib/elastic/latest/note_instance_proxy.rbthat indicates data might be present. We still need to add permission fields and namespace info, so search cannot be implemented until this is done. - Routing strategy will likely need to be updated, see tech details below
Technical details
- Additional fields that need to be indexed for
Wikitype notes only:namespace_id,wiki_access_level - Confirm system notes are not indexed (should be the case)
- Group wiki notes won't have a
project_id, so we'll need to figure out how to route them. The routing strategy might need to change for the Notes index. We can move ton_ROOT_ANCESTOR_ID(used in Wiki and Project index). That requires an Advanced search migration to use zero downtime reindexing to reindex using new routing.
Edited by 🤖 GitLab Bot 🤖