Skip to content
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

No results returned when searching a column using regex OR condition #30

Open
ZackaryMurphy opened this issue Jan 18, 2017 · 1 comment

Comments

@ZackaryMurphy
Copy link

Using the column search function as shown here: https://datatables.net/reference/api/column().search() with a regex of 'value|value2|value3' returns nothing because the plugin makes no attempt to split regex searches, so instead of a query of where col like %value% or col like %value2% ...etc, the produced sql is of the form where col like %value|value2|value3%. This issue would likewise extend to any form of regex searching with the plugin.

@ypnos-web
Copy link
Owner

In general, the plugin does not support all client-side features of datatables on the server side (e.g. 'smart search'). However regex searching is a functionality that is general enough that it would merit being supported.

In this case my preferred solution would be to pass the regex to the database. MySQL and PostgreSQL support regex search and I would expect others to do so, to. However, Cake's ORM currently does not wrap it so we would need to write our own, database-specific, code for it.

Are you interested in contributing to this significant work, e.g. preparing a pull request?

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

No branches or pull requests

2 participants