Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Custom Fields Search is time
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 2 years, 4 months ago.
- AuthorPosts
- May 8, 2022 at 11:03 pm #37736
Hi,
I try to set in Frontend Search / Custom fields a time filter. The custom field value is in time format, and I select Text in the AjaxSearch Pro, and select the operator to more or equal and less or equal, but in the result is not showing properly. I not found wich logic was apllied in it.
(For example when I set the start time is 8:00, then show only 4 result, but the most time is after 8:00)
Can I set anyway this search type?Thanks forwardly,
Peter DerAttachments:
You must be logged in to view attached files.May 9, 2022 at 1:10 pm #37742Hi Peter,
I don’t think that is going to work at all. If the time is stored in that format, it is not comparable as a numeric value unfortunately. The SQL does some type casting to deal with non-numerical characters, but I hihgly doubt, that this will work either way.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 9, 2022 at 8:12 pm #37751Hi Ernest,
Thank you for your answer. I fear from that. Yesterday I tried search solution, and found the SQL Query string comparison is working with alphabetic order. (https://stackoverflow.com/questions/26080187/sql-string-comparison-greater-than-and-less-than-operators). But I don’t know, what happend with the value, when I select in AjaxSearch Pro Custom field filter to text and select one numeric operator. The plugin make any conversion in text value?
(I tried change custom field type to text, but it wouldn’t work same.)Thanks forwardly,
Peter DerMay 11, 2022 at 2:06 pm #37765Hi,
Yes – the input value is sanitized and converted to a numeric value. It has to be done to prevent SQL injection attacks.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.