Search where any column contains X and any column contains Y
Search where any column contains X and any column contains Y

Is there a simple way to do an AND search using .search()?
If I do the following I get 10 results:
myDatatable.search("reed med");
myDatatable.draw();
One of which has a field with the value "john".
I was hoping this would work:
myDatatable.search("reed med");
myDatatable.search("john");
myDatatable.draw();
But this appears to search for "reed med" OR "john" as I get 28,000+ results.
Is there a way to search for a match when any column contains X and any column also contains y?
This discussion has been closed.
Answers
I think it's because my dataTable is serverside. I've looked at the SQL and it seems to only pass across the last .search() value.
Hi @nicontrols ,
Yep, as you say,
search()
will replace any previous search string that was being used - this is the same behaviour whether the table is client side or server side.Cheers,
Colin