You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, let me start by saying this component is AMAZING! This saved me lots of programming hours.
I'm now trying to implement individual column searching, as specified by the DataTables documentation on https://datatables.net/examples/api/multi_filter.html, but I'm unable to make it work properly. It seems the search function will work correctly if the data is all in memory, but it seems to fail when the data is loaded from the server.
I'm not really sure this is an issue on the DataTables component itself or something you can fix here, so please feel free to direct me to the proper help channel if needed.
Right now my code is implemented exactly as found in the documentation I pointed above, but the search works only on the first column I try whatever it is. From the second column on, the search is returning something I cannot identify. With my data, the first search (which is a username) returns a total of 987 documents. The second criteria alone (which is a table name) returns a total of 292,056 documents and both should return 27 documents ($and) or 293,016 documents ($or) but the table info gives me back 286,126 entries which I cannot understand because it doesn't fits any logical criteria.
Can you help? What I could possibly be doing wrong?
Thanks in advance,
/Edson
The text was updated successfully, but these errors were encountered:
I actually found out what is happening with the queries. The component is doing a "OR" with the fields but in MongoDB the search is performed using regular expressions to simulate a search that "contains" the column text. Using the 'contains' syntax in MongoDB (i.e. { $or: [ { field1: /.value1./i }, { field2: /.value2./i } ] }) the search returns the exact number of records I was seeing before.
This is not what I expected, because if I do the same search using the Datatables component alone, the multi-column search is performed like a "AND" operator, so I now believe this change in behaviour is directly related to the search enhancements implemented in Tabular.
Could you please verify if this is the case, and if so, clarify if this is the planned behaviour or is this a bug?
Either way, the search in this package needs to be redesigned. Doing a massive $or$regex is causing us optimization problems with MongoDB's Atlas constantly complaining. There's no way to write a good index for it. We're about to do a fork and rework this, unless I can find a ticket or developer on here that's also doing this or is intereseted.
First of all, let me start by saying this component is AMAZING! This saved me lots of programming hours.
I'm now trying to implement individual column searching, as specified by the DataTables documentation on https://datatables.net/examples/api/multi_filter.html, but I'm unable to make it work properly. It seems the search function will work correctly if the data is all in memory, but it seems to fail when the data is loaded from the server.
I'm not really sure this is an issue on the DataTables component itself or something you can fix here, so please feel free to direct me to the proper help channel if needed.
Right now my code is implemented exactly as found in the documentation I pointed above, but the search works only on the first column I try whatever it is. From the second column on, the search is returning something I cannot identify. With my data, the first search (which is a username) returns a total of 987 documents. The second criteria alone (which is a table name) returns a total of 292,056 documents and both should return 27 documents ($and) or 293,016 documents ($or) but the table info gives me back 286,126 entries which I cannot understand because it doesn't fits any logical criteria.
Can you help? What I could possibly be doing wrong?
Thanks in advance,
/Edson
The text was updated successfully, but these errors were encountered: