Ensure zoekt traversal id search uses prefix search
What does this MR do and why?
Avoids a scenario where a traversal ID search could return a false positive.
AI Summary
This change improves how the search system filters results by group hierarchy. Previously, the code was manually building search filters for group traversal IDs (which represent the organizational structure). Now it creates a dedicated helper method called
by_traversal_idsthat standardizes this process.The new method automatically adds a prefix search pattern (using "^" symbol) to make the searches more precise, and includes error handling to prevent empty searches. This makes the code cleaner, more consistent, and reduces duplication since the same filtering logic was being written in multiple places.
The change also updates test files to reflect the new prefix search pattern, ensuring the tests match the updated behavior.
References
Screenshots or screen recordings
| Before | After |
|---|---|
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.