an
groups-icon

custom select search field – missing values

Wait a minute... This content is very very old. We no longer sell or support this theme version. New Topics
  • Version 9
    Jan Tondera
    0 points
    Beginner

    Hello!

    I have discovered that search function with select type field does not work properly with directories larger than 500 listings.

    It’s due to this code in class.core.php, lines 642 or so:
    [code title=”class.core.php”]
    $SQL = “SELECT “.$wpdb->postmeta.”.post_id FROM “.$wpdb->postmeta.”
    INNER JOIN “.$wpdb->posts.” ON ( “.$wpdb->postmeta.”.post_id = “.$wpdb->posts.”.ID AND “.$wpdb->posts.”.post_status=’publish’)
    WHERE “.$wpdb->postmeta.”.meta_key = (‘”.strip_tags($field).”‘) LIMIT 0,500″;[/code]

    So, if you add a 502nd listing with a new value of a searchable field, then this value will not be available in select options.

    I have a directory with over 5000 listings, so rising the LIMIT in SQL query is not an option (PHP will run out of memory).

    Could you please advise how to optimise the code?

    Thank you!

    March 26, 2015 at 7:59 pm
  • fiona wylder
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    March 26, 2015 at 9:34 pm
  • Jan Tondera
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    March 27, 2015 at 8:24 pm
  • Jan Tondera
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    April 2, 2015 at 11:50 am

523

Views

3

Replies