-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple fields for value filter #135
Conversation
Current coverage is 100% (diff: 100%)@@ master #135 diff @@
====================================
Files 10 10
Lines 290 298 +8
Methods 51 52 +1
Messages 0 0
Branches 0 0
====================================
+ Hits 290 298 +8
Misses 0 0
Partials 0 0
|
|
||
return $e; | ||
}); | ||
if (!empty($expressions)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would leave out !empty()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a copy/paste from Like
filter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah ideally they both remove the not necessary cloaking. Bot no big deal.
Good idea 👍 |
@@ -1,6 +1,9 @@ | |||
<?php | |||
namespace Search\Model\Filter; | |||
|
|||
use Cake\Database\Expression\QueryExpression; | |||
use Search\Manager; | |||
|
|||
class Value extends Base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couldn't we make a MultiValue instead, this will otherwise be breaking change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would stay at Value
otherwise we have an inconsistency between the usage of Like
and Value
. Where is the breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default config keys have changed named
What about merging? |
As said before I am 👍 on merging this |
Explicit multi field tests wouldn't hurt... |
Tests and readme update required. |
@steefaan Are you able to finish it up or do you want some help here? |
{ | ||
parent::__construct($name, $manager, $config); | ||
|
||
$mode = $this->config('mode'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add an inline comment here:
// For backwards compatibility
etc
How can we finish this up? Anyone interested? |
I'll finish it up... |
I think it would be nice to provide the possibility to search a value inside multiple fields at once. This way the
Value
filter acts asLike
filter. Code is BC, see the constructor.