-
Notifications
You must be signed in to change notification settings - Fork 20
Search Fails For Number/Date Mongoose Schema #4
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
Comments
Unfortunately, I'm not able to fix this right now. We use a regex to allow text search, but it really breaks when searching for numbers. If you are willing to contribute, I would gladly review a PR. Perhaps checking the data type and only applying the regex when it is a text field. A faster solution on your side, although a far from ideal one, is to duplicate the numeric field as a string, so you would end up with two fields, |
I've found solution for this. It's not perfect but at least works :D https://gist.github.com/elderapo/b092d960e0c534a412d359dbf32fb40f Which produces something like: |
hello I have problem to implement datatable-query to my app |
sorry my mistake |
I tried the proposed solution of apr 1, as a patch on v0.20, but the search does not work after that. |
It is very bad that there are still no solution! Mb someone i could help.
change function buildFindParameters like this:
|
I'm sorry for being unresponsive, but as I stated before, I'm not actively maintaining this module anymore. @ikonduktor perhaps you could turn your comment into a PR, then it could land in this module and creating another one would be unnecessary. If someone is willing to become a contributor, that is something that I would happily accept. |
Thanks @ikonduktor for your great answer. |
HI i use this in model to get record. how i can get other collection
};` for example i show title and status from one model and i also want to show category title from other table. what i can do for this |
any one solve this issue please.. |
Hi, So from frontEnd when creating datatable you need to set option "searchable : false " in columns array e.g : columns: [ as you can see only name field is searchable. So it will not cause any issue. |
@s4suryapal thanks for you answer anyway. I have created my own datatable helper which solve those problems in both server and in UI level. |
For example, when searching for a single letter ("t" in this case) the search is accurate when all number, and date fields are set to searchable:false. Otherwise this error is returned:
campaignEstimate is a simple number such as 1234
The text was updated successfully, but these errors were encountered: