feat(search): implement Node Affinity for filter controls and hooks#621
Open
martinshub-tech wants to merge 1 commit into
Open
feat(search): implement Node Affinity for filter controls and hooks#621martinshub-tech wants to merge 1 commit into
martinshub-tech wants to merge 1 commit into
Conversation
|
@martinshub-tech Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this pr closes #476
Overview
Implemented the Node Affinity configuration for search filter controls. This feature allows users to route search/filter execution to specific cluster nodes (Auto, Primary, Replica, or Edge Cache) dynamically.
nodeAffinityto theFilterStatestructure inside bothuseSearchFiltershooks (Pages Router & App Router versions).nodeAffinitystate to sync with theaffinityquery parameter in URL, supporting state preservation across navigations.FilterSidebarcomponent implementations with clear descriptions for each routing mode.Cpuicon from Lucide-React and clean radio inputs following the application’s design system (borders, peer-checked backgrounds, and hover micro-animations).Files Changed / Added
src/app/hooks/useSearchFilters.tsnodeAffinitysupport to App router search filter hook.src/hooks/useSearchFilters.tsxnodeAffinitysupport to Pages router search filter hook.src/app/components/search/FilterSidebar.tsxsrc/components/search/FilterSidebar.tsxsrc/app/components/search/__tests__/FilterSidebar.test.tsxsrc/components/search/__tests__/FilterSidebar.test.tsxRationale
Previously, search queries were dispatched without any node routing constraints. This resulted in redundant or sub-optimal execution targets in replica-heavy or edge-distributed environments. By adding Node Affinity to the Filter Controls, we empower users/developers to specify execution targets (such as requesting strong consistency from the Primary Cluster or low-latency from the Edge Cache), improving search quality, caching efficiency, and database load distribution.
Testing
onFilterChangecallback with the updatednodeAffinitypayload.