Custom Fields Search is time

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 Ernest Marcinko 4 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #37736
    derp
    derp
    Participant

    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 Der

    Attachments:
    You must be logged in to view attached files.
    #37742
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi 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 :)


    #37751
    derp
    derp
    Participant

    Hi 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 Der

    #37765
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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 :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.