feat: implement full-text search with q parameter #1652
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.
Feat: Implement Full-Text Search with
qParameterProblem
The
qparameter for full-text search was documented and expected by users but was not actually implemented in the codebase. When users tried to search with queries likeGET /posts?q=title, they received empty results instead of filtered data.Root Cause
The current filtering logic in
src/service.tsonly handled:item=value)item_gt,item_lt, etc.)_embed,_sort, etc.)The
qparameter was treated as a regular field name, which didn't exist in the data, resulting in no matches.Solution
Implemented comprehensive full-text search functionality:
Features Added
q=sushiandq=Sushiboth workq=alimentfinds "Alimentação"Technical Implementation
qparameter inService.find()method#searchInItem()and#searchInObject()methods for recursive searchCode Changes
src/service.ts- Added search functionalitysrc/service.test.ts- Added test coverageTesting
Usage Examples
🔗 Related Issues
This fixes the commonly reported issue where users expected the
qparameter to work for full-text search but it returned empty results.Checklist
Impact