-
Notifications
You must be signed in to change notification settings - Fork 0
Seach Field ‐ Developer Task Breakdown
-
Review the functional specification document in detail
-
Walk through:
- Search scope
- Supported entities
- Ranking rules
- Security constraints
-
Confirm MVP boundaries:
- No autocomplete
- No semantic or intent-based search
Finalize entity list:
- Help Requests
- Users
- Organizations
- Categories / Tags
- Companies (if applicable)
Identify searchable fields per entity:
- ID
- Title / Name
- Description
- Tags
-
Document which roles can search which entities
-
Define authorization rules per entity:
- Ownership
- Assignment
- Visibility / scope
-
Get sign-off from Product and Security teams
-
Extract user context from auth token/session:
user_idroleorganization_id- Permissions / scopes
-
Create a reusable authorization context object
- Implement authorization-aware filters per entity
- Ensure filters are applied before search execution
- Prevent full-table or unscoped searches
-
Create a centralized search service/module in Flask
-
Accept:
- Search text
- Authorization context
- Result limit
-
Return a unified result structure across all entity types
-
Query only help requests the user is authorized to access
-
Support partial keyword matching
-
Apply weighted relevance:
- ID and title matches (highest weight)
- Description matches (lower weight)
-
Validate that no unauthorized records are queried
- Users (role-filtered)
- Organizations (visibility-based)
- Categories / Tags (public or scoped)
- Companies (if applicable)
-
Apply weighted scoring:
- Exact ID matches
- Name / title matches
- Description matches
-
Normalize scores across entity types
- Merge results from multiple entities
- Sort results by relevance score
- Enforce strict result limits for performance
-
If only one high-confidence result exists:
- Return navigation target directly
- Skip result list view
- Map each entity type to its corresponding detail/context page
- Include entity identifiers and routing metadata
-
Endpoint:
/api/search
Request:
- Query text
Response:
- Entity type
- Entity ID
- Display title
- Navigation URL
- Relevance score
- Validate that the API rejects unauthorized access attempts
- Ensure consistent authorization behavior across all entity types
- Add search input to the dashboard header
- Visible only to authenticated users
- Trigger search on submit / Enter key
- Render ranked results
- Show entity type indicators
- Support direct navigation on click
- No results found
- Input too short or invalid
- Single auto-navigation scenario
- Add database indexes on searchable fields
- Validate response time ≤ 500 ms
- Enforce strict result limits
- Verify search does not expose unauthorized entities
- Attempt cross-role searches
- Validate no metadata leakage
- Log search queries (excluding sensitive data)
- Track latency and error rates
- Monitor unusual or suspicious search patterns
- Role-based search access
- Mixed keyword searches
- Partial matches
- Auto-navigation behavior
- Backend and frontend integration flow
- Permission enforcement validation
- Product validation
- Security validation
- Performance validation
- Secure universal search API
- Dashboard-integrated search bar
- Role-aware search enforcement
- QA test cases and supporting documentation