CakeDC / search

Search Plugin for CakePHP
http://cakedc.com
Other
355 stars 169 forks source link

Documentation contains a bit misleading... #190

Closed tsmsogn closed 8 years ago

tsmsogn commented 9 years ago

Hi,

Thanks about a great plugin. But I think documentation contains a bit misleading. wildcardAny and wildcardOne value is not changeable in Model::$filterArgs.

For example: https://github.com/CakeDC/search/blob/master/Docs/Documentation/Examples.md#advanced-usage

Please let me know if I wrong. :)

dereuromark commented 9 years ago

What do you mean with not changeable? What is your setup? And what did you expect to happen?

tsmsogn commented 9 years ago

Thank you for replying.

In https://github.com/CakeDC/search, I think I can override wildcardAny and wildcardOne values only in bootstrap.php. But docs explains like bellow.

public $filterArgs = array(

    // use custom wildcards in the frontend (instead of * and ?):
    'search_custom_like' => array(
        'type' => 'like',
        'encode' => true,
        'before' => false,
        'after' => false,
        'wildcardAny' => '%', 'wildcardOne' => '_'
    ),

);

It should be unified either. I think I would override wildcardAny and wildcardOne values in Model::$filterArgs too. :)

dereuromark commented 9 years ago

You should always mention the version, I assume you are using 2.x.

There are no explicit tests for it, but looking at https://github.com/CakeDC/search/blob/master/Model/Behavior/SearchableBehavior.php#L242 and https://github.com/CakeDC/search/blob/master/Model/Behavior/SearchableBehavior.php#L244 or https://github.com/CakeDC/search/blob/master/Model/Behavior/SearchableBehavior.php#L310 it sure looks like as if they are merged just fine, if passed as option. And they are also merged properly from the field settings. So unless you can proof otherwise it sure looks like it works as you expect it to work.

tsmsogn commented 9 years ago

Thank you for advice.

Yes, I am using 2.x. I think it can not override wildcard in each fields like docs. So, I made patch. tsmsogn@a92133d7b3cb35c0f178b89d5df556e68899ba8b

antoniovassell commented 9 years ago

Hey @tsmsogn is this issue resolved for you or its still an issue?

Megslalk commented 8 years ago

Hi, closing this issue, please reopen if still needed.