Smart searching doesn't work
Smart searching doesn't work

Hi,
My smart searching doesn't work. If I type "Lyon" it find "Lyon", but if I type "Ly" it doesn't find "Lyon" in my city name column.
However, smart searching is supposed to be activated, since by default it is on true.
There is my code :
$("#filter_search input").on('keyup change', function(e) {
if (e.keyCode == 13) {
api
.column($(this).parent().index()+':visible')
.search(this.value)
.draw();
}
});
Thank you.
This discussion has been closed.
Replies
Smart searching is working in this example:
http://live.datatables.net/powuciki/1/edit
Please provide a link to your page or a test case replicating the issue so we can help debug.
Kevin
Hi,
Here is a test link :
http://flanerbouger.studiolab.fr/test/cities
You have
serverSide: true,
which menas your server script is responsible for the search. When searching the SSP process, as documented here, will send the search terms to the server. For example when searching "me" in the Department column:Your server script will need to perform the "Smart" search. Are you using a Datatables provide server script or your own?
Kevin
I use the Symfony Datatable Bundle from Omines, it manages everything:
This script above generates the datatable;
And my js full script:
This is not something Datatables provides. You will need to contact their support to find out what to do or if they support something similar to "Smart" searching.
Kevin
Ok, if not if I turn off the server side it might work?
The Smart search capability is a client side process. Yes, if you turn off server side processing it should work. But I'm not sure how the server script you are using works. I would expect it to return all the rows. But its hard to say what its behavior will be if it doesn't see the server side parameters.
Kevin
By removing the server side it doesn't work either ... All I have to do is contact the bundle support!
Your example still has
serverSide: true
. If you want us to take a look please remove or comment out this line. This is assuming that the problem is with the search and not loading the data.Kevin
I deleted the line from the server side : https://127.0.0.1:8000/test/cities
That is local to your network only. We can't reach it. For us to look you will need to remove it form http://flanerbouger.studiolab.fr/test/cities .
Kevin
it's good I made the modification on the server
Can someone help me ?
http://flanerbouger.studiolab.fr/test/cities
I don't know anything about the
Symfony Datatable Bundle from Omines
but it is still using server side processing even though you removed theserverSide: true
option. You can see the XHR requests and responses using the browser's network inspector. The initial response is with only 50 rows and each search is fetching from the server.You will need to work with their support to find the best solution for your search requirements. Maybe they can tell you how to disable server side processing or add the Smart Search capability you want.
Kevin