Skip to content

Bynt-1381: Mirror Search Optimizations on Actors and Incidents#127

Merged
tarekio merged 14 commits intosearch-v4from
bynt-1381-mirror-search-changes
Jul 10, 2025
Merged

Bynt-1381: Mirror Search Optimizations on Actors and Incidents#127
tarekio merged 14 commits intosearch-v4from
bynt-1381-mirror-search-changes

Conversation

@cango91
Copy link
Contributor

@cango91 cango91 commented Jul 2, 2025

Jira Issue

  1. BYNT-1381

Description

Implements comprehensive migration for Actors and Incidents, covering SearchUtils refactoring from (queries, ops) tuple to unified query objects, cursor-based pagination with dual query strategy, complete database index audit (all 50 indexes introduced in branch search-v4 migrations are also defined on ORM-level), and minimal serialization patterns

Checklist

  • Tests added/updated
  • Documentation updated (if needed)
  • New strings prepared for translations

API Changes (if applicable)

  • Permissions checked
  • Endpoint tests added

Additional Notes

[Any other relevant information]

cango91 and others added 7 commits July 2, 2025 13:46
- Migrate actor_query() and incident_query() to return (stmt, conditions) tuples
- Optimize text search with individual ILIKE conditions for better index performance
- Remove obsolete build_actor_query and build_incident_query methods
- Update get_query() to handle unified query objects for all entity types
- Preserve all original search functionality
- Migrate api_actors() from old (queries, ops) union/intersect to unified query objects
- Fix api_incidents() bug with direct su.get_query() call
- Implement dual query strategy: fast path vs count path
- Add cursor-based pagination with id < cursor for performance
- Include optional total count with include_count toggle
- Minimal serialization for better performance
- Consistent response format with bulletins: nextCursor, meta, totalType
- Remove GET /admin/api/actors endpoint, keep only POST with cursor pagination
- Remove GET /admin/api/incidents endpoint, keep only POST with cursor pagination
- Add CursorPaginationResponse schema for cursor-based pagination structure
- Add ActorQueryRequest and IncidentQueryRequest schemas with cursor parameters
- Update ActorsResponse and IncidentsResponse to use CursorPaginationResponse
- Document nextCursor, meta (currentPageSize, hasMore, isFirstPage), total, totalType fields
- Update descriptions to highlight cursor-based pagination benefits for large datasets
@cango91 cango91 self-assigned this Jul 4, 2025
@tarekio tarekio requested a review from level09 July 9, 2025 13:14
@tarekio tarekio merged commit 568bb30 into search-v4 Jul 10, 2025
2 of 3 checks passed
@tarekio tarekio deleted the bynt-1381-mirror-search-changes branch July 10, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants