DuncanWilder / BooleanSearchParser

A way to translate Boolean Search logic into MySQL Fulltext Parameters
The Unlicense
6 stars 3 forks source link

Added optional param allowing OR type search on each word if operator not specified. Fixed handling of multi-hyphen-words #9

Open Aledar opened 2 years ago

DuncanWilder commented 2 years ago

Hey @Aledar , thanks for taking an interest in updating this project. It's been a few years though, so my PHP is a little rusty and there's probably some quirks in this code as it was written when I was in my first dev job 😅

I'm all for updating this codebase and releasing a new version, but I feel there are 2 things that jump out at me.

  1. It looks like from the readme the default operator was OR, but your change has made AND the default. This would constitute a breaking change. It would be good to avoid this and reverse the logic (where OR is the default again)
  2. There are some tests in the tests folder - do these still pass with these changes? Are there any tests that you could write to provide additional confidence around these changes

I feel with those changes we'd be in a great place to merge this PR 💪

Aledar commented 2 years ago

Hi @DuncanOgle, thanks for taking the time to respond.

Seems fitting I am trying to contribute to this project which you wrote in your first dev job whilst I am in my first dev job. This is also my first github contribution so apologies if I have or do overlook any etiquette or get my terms wrong.

On 1, I believe the default operator was AND so the changes should not be a breaking change for existing users. On 2, good point, I added an equivalent OR test for each existing test as well a few tests for multi-hyphened words.

Again, thanks for taking the time to respond, and considering the pull request.

Cheers, Aledar