Add search_scope in options
What does this MR do and why?
Sometimes we need to know the scope of the search in the elastic proxy classes. For instance, to hide the archive results we have to behave differently for project-level search. Instead of checking the combination of option[:group_id] and option[:project_id]
we can check this option to determine the scope of the search.
This MR also makes use of this option to show again the notes from the archived project on performing the project-level search. I have removed any archived
related code from the basic search for notes. You can refer to this MR where the archived related code has been added for basic search for notes. It has been completely reverted means the behavior for notes basic search is now like before. In addition to that, I have added a condition options[:search_scope] != 'project'
in archived_filter_applicable?
in the NoteClassProxy
to show the notes from archived projects for advanced project level search
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
First enable this feature_flag search_notes_hide_archived_projects
On the master
branch you should NOT see the notes in the search results for project-level search but on this branch, you should be able to see the notes from the archived project in the search results.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.