Skip to content

More generous search#944

Open
d-buchmann wants to merge 29 commits intoPart-DB:masterfrom
d-buchmann:tweak-search
Open

More generous search#944
d-buchmann wants to merge 29 commits intoPart-DB:masterfrom
d-buchmann:tweak-search

Conversation

@d-buchmann
Copy link
Contributor

@d-buchmann d-buchmann commented May 28, 2025

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
Copy link

codecov bot commented May 28, 2025

Codecov Report

❌ Patch coverage is 40.90909% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.75%. Comparing base (05a9e4d) to head (a131d1c).

Files with missing lines Patch % Lines
src/DataTables/Filters/PartSearchFilter.php 40.90% 13 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #944      +/-   ##
============================================
- Coverage     54.77%   54.75%   -0.03%     
  Complexity     8012     8012              
============================================
  Files           601      601              
  Lines         25691    25702      +11     
============================================
  Hits          14073    14073              
- Misses        11618    11629      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jbtronics
Copy link
Member

I wonder if it might be better to use the fulltext seach capabilities of the database then trying to implement more complex searches ourselves.

@virtadpt
Copy link

@jbtronics Generally speaking, that's always a good idea. Let the database server do the heavy lifting.

@d-buchmann
Copy link
Contributor Author

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.

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.

Better search

3 participants