Feat/search optimization#323
Merged
Merged
Conversation
…ions and add new Redis modules
…ller.ts and auth.service.ts
…ions and add new Redis modules
…for page and limit parameters
…asticsearch settings
…ed Elasticsearch settings
…anitization Co-authored-by: Copilot <copilot@github.com>
|
@Power70 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.
Linked Issue
Closes #290
What does this PR do?
This PR fully addresses Search Index Optimization by hardening Elasticsearch query execution, improving index setup/migration behavior, and validating API-level search parameters at the controller boundary. It introduces bounded pagination, query/filter sanitization, reduced payload search requests, and robust index normalization behavior for keyword filters. It also adds an opt-in reindex-on-boot path for existing environments so new index settings/mappings can be applied without manual patching.
Type of change
Change summary
Search API hardening and behavior improvements:
page,limit) with boundary checks.category,level,language) with trimming/lowercasing and array deduplication._sourcefield selection to reduce payload size.track_total_hitsand paginated response metadata (page,limit).tags,category,level,language) and tuned refresh interval.SEARCH_REINDEX_ON_BOOT=true, rebuildingcoursesindex using the current optimized mapping.Test coverage added for search optimization:
Audit and platform consistency updates:
Scope note:
Pre-merge checklist (required)
Explanation: Targeted validations were executed locally for the search scope; full pipeline commands should still run in CI before merge.
Branch & metadata
feature/issue-<N>-<slug>/fix/issue-<N>-<slug>conventiondevelopormain)Code quality & tests
npm run lint:ci— zero ESLint warningsnpm run format:check— Prettier reports no changes needednpm run typecheck— zero TypeScript errorsnpm run test:ci— all tests pass, coverage ≥ 70%.spec.tsunit testsError handling & NestJS best practices
class-validator/class-transformerdecorators and are wired through NestJS pipes (e.g. globalValidationPipeor explicit)any/unknownreaching the domain)BadRequestException,UnauthorizedException,ForbiddenException,NotFoundException) instead of genericErrorLoggeror central logger service) with meaningful, structured messagesAuthGuard, role/permissions guards, custom guards) are applied to all new/modified endpoints where appropriateAPI documentation / Swagger
/api(or Swagger UI) reflects new/changed endpoints correctlyBreaking changes
Breaking change description (if applicable)
N/A. No breaking API change is intended.
Test evidence (required)
Commands run locally
Manual / API verification
Screenshots / recordings (if applicable)
N/A for backend-only changes.