Skip to content

Conversation

@Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Dec 4, 2025

Summary

  • Implement server-side type filtering using Elasticsearch post_filter for accurate aggregation counts
  • Add terms aggregation on type field to return doc/api counts from the server
  • Refactor search API types: rename SearchRequest/SearchResponse to SearchApiRequest/SearchApiResponse
  • Replace tuple return type in ISearchGateway with new SearchResult record
  • Return aggregations nested under aggregations.type for future extensibility
  • Update frontend to fetch filtered results from server instead of client-side filtering
  • Add typeFilter state to search store for consistent filter state management
  • Split ElasticsearchIngestChannel and ElasticsearchMarkdownExporter into partial files for better code organization

Technical Details

Backend

  • ISearchGateway.SearchAsync now returns SearchResult with TotalHits, Results, and Aggregations
  • Search endpoint accepts type query parameter (values: doc, api)
  • post_filter ensures aggregation counts reflect total matches regardless of active filter
  • New SearchAggregations record wraps type counts for clean JSON structure

Frontend

  • Filter selection triggers new API request with ?type= parameter
  • Aggregation counts from server displayed in filter buttons
  • Removed client-side result filtering (server handles it)
  • Query cache keys include typeFilter for proper result caching
cursorful-video-1764847637167.mp4

…filter

- Implement server-side type filtering using Elasticsearch `post_filter` for accurate aggregation counts
- Add terms aggregation on `type` field to return doc/api counts from the server
- Refactor search API types: rename `SearchRequest`/`SearchResponse` to `SearchApiRequest`/`SearchApiResponse`
- Replace tuple return type in `ISearchGateway` with new `SearchResult` record
- Return aggregations nested under `aggregations.type` for future extensibility
- Update frontend to fetch filtered results from server instead of client-side filtering
- Add `typeFilter` state to search store for consistent filter state management
- Split `ElasticsearchIngestChannel` and `ElasticsearchMarkdownExporter` into partial files for better code organization

- `ISearchGateway.SearchAsync` now returns `SearchResult` with `TotalHits`, `Results`, and `Aggregations`
- Search endpoint accepts `type` query parameter (values: `doc`, `api`)
- `post_filter` ensures aggregation counts reflect total matches regardless of active filter
- New `SearchAggregations` record wraps type counts for clean JSON structure

- Filter selection triggers new API request with `?type=` parameter
- Aggregation counts from server displayed in filter buttons
- Removed client-side result filtering (server handles it)
- Query cache keys include `typeFilter` for proper result caching
@Mpdreamz Mpdreamz requested a review from a team as a code owner December 4, 2025 11:30
@Mpdreamz Mpdreamz requested a review from cotti December 4, 2025 11:30
@Mpdreamz Mpdreamz self-assigned this Dec 4, 2025
@Mpdreamz Mpdreamz enabled auto-merge (squash) December 4, 2025 13:56
@Mpdreamz Mpdreamz merged commit 5570c23 into main Dec 4, 2025
28 checks passed
@Mpdreamz Mpdreamz deleted the fix/search-type-aggs branch December 4, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants