Update search services to respect configured default scope setting

What does this MR do and why?

This change improves how the search feature determines which category (like "projects", "issues", etc.) to show by default when users perform a search.

Previously, the system had hardcoded defaults and some special logic for automatically switching to code search. Now it introduces a centralized system that:

  1. Removes automatic code search switching - The system no longer automatically redirects users to the "blobs" (code files) category when they use certain search terms like "filename:" or "path:".

  2. Adds configurable default search categories - Administrators can now set a global default search category through application settings, instead of always defaulting to "projects".

  3. Implements smart fallback logic - When the configured default isn't available (due to permissions or feature flags), the system intelligently picks the best available option rather than breaking.

  4. Centralizes scope selection - Instead of having different logic scattered across multiple files, there's now one place that handles determining which search category to use, making the code more maintainable.

The changes make search behavior more predictable and customizable while ensuring users always get a working search experience even when their preferred category isn't available.

References

Screenshots or screen recordings

Before After
image
image

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #567844

Edited by Siddharth Dungarwal

Merge request reports

Loading