garvincasimir/csharp-datatables-parser

Question - Exact Search

yarns123 opened this issue · 2 comments

Any tips how to force exact search? Now when i try search for let say 'test' im getting all rows containing it ('test', 'tests, 'testing', etc.). How can i get only this ones which are equal?

Doing an exact or starts with search is not difficult. Unfortunately, by default, the JS library doesn't document any parameters I can use to implement that logic. If you know of anything please share. Here is a link to the reference I used: https://datatables.net/manual/server-side.

In theory, you should be able to send arbitrary parameters through the ajax call to the server. If you can confirm that then you can send your own search[wholematch], search[startswith] or search[endswith].

The only option right now is regex but for me it is less desirable. Someone else asked if I would take a pull request for regex but I have not seen their submission. Unfortunately, I don't have the time to implement it myself. What database backend are you using?

I added a feature that should address this. It is only in the repo for now.