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

Force research when regex is active #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

piet23
Copy link

@piet23 piet23 commented Jan 6, 2017

The problem is that when using regex and querying something like "item1|item2", only item1 is actually filtered, as the filter is always applied against the already filtered data. To ensure that the "or"ed query is properly applied, one possibility is to remove the last character and add it again (the "prevSearch.length > input.length" condition fires).

This fix forces a new search against the master array when regex is set to true, so that such "or"ed queries will behave as expected.

@DataTables
Copy link
Collaborator

Thanks - this does seem like a sensible idea. I'd like to do some tests as it will make regex slower, but frankly I don't really see how that can be avoided unless you have any genius ideas?

@piet23
Copy link
Author

piet23 commented Jan 10, 2017

Unfortunately, I have no great ideas in that regard, no. For us the use of "or"ed queries is most important, so checking whether the added text contains a "|" might prevent the full research in many cases, but I assumed that this would not be general enough.

On a side note: One further problem when using regex we have stumbled over, and have not yet fixed, is the following: When regex is activated, whenever you enter something like a backslash, some paranthesis or other special characters, errors are logged in the console (from the transformation to a RegEx) until the search string can be successfully transformed into a RegEx again.

Avaruz pushed a commit to Avaruz/DataTablesSrc that referenced this pull request Jan 15, 2024
…DataTables.AspNet.Samples.WebApi2.BasicIntegration/Microsoft.Owin.Security.Cookies-4.2.2

Bump Microsoft.Owin.Security.Cookies from 3.0.1 to 4.2.2 in /samples/DataTables.AspNet.Samples.WebApi2.BasicIntegration
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.

2 participants