Part-DB-server
Part-DB-server copied to clipboard
More generous search
Split the keyword into tokens (at spaces). Search for every token individually, then combine results with AND. Caution: This has no effect on the typeahead search, I will have a look at this soon. Should fix #892.
Codecov Report
:x: Patch coverage is 33.33333% with 14 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 58.59%. Comparing base (14a4f1f) to head (3b69151).
:warning: Report is 9 commits behind head on master.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| src/DataTables/Filters/PartSearchFilter.php | 33.33% | 14 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #944 +/- ##
============================================
- Coverage 58.63% 58.59% -0.05%
- Complexity 7094 7095 +1
============================================
Files 571 571
Lines 22673 22686 +13
============================================
- Hits 13294 13292 -2
- Misses 9379 9394 +15
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
I wonder if it might be better to use the fulltext seach capabilities of the database then trying to implement more complex searches ourselves.
@jbtronics Generally speaking, that's always a good idea. Let the database server do the heavy lifting.
The feature is plain simple. I just make the query more complex by splitting the search string. So, the database server is still doing the heavy lifting, even though it's not making use of additional database features (which I didn't know of before :) I did my research and see that native full-text search would definitely be the better solution, but as I see it, it would require quite a bit of work, because all databases have different syntax, feature sets and restrictions. Doctrine also doesn't seem to have this built-in - please correct me if I'm wrong.