• Resolved dede812

    (@dede812)


    In Directorist’s Search function how do you return results only for exact matches? That is, how do I remove wildcards or wildcarding?

    For reference, I am using only one search field (postcode) and only want to return results for exact matches – that is, for 4 digits only. But if I type in a space the entire directory is returned in the results page; if I type in a single digit then those directory entries with that digit in the postcode are returned. How can the wildcard function be turned off so exact matches are returned in he results?

    Thx.

Viewing 1 replies (of 1 total)
  • Plugin Support Mahfuzul Alam

    (@mahfuz87)

    Hi

    Please use the following code at the end of the?functions.php?file of the currently activated Child theme.
    If you do not have any child theme installed, please install one.
    You can also use the?Code Snippet?plugin to implement this code.

    add_filter( 'atbdp_listing_search_query_argument', function( $args ) {
    if ( empty( $args['s'] ) || strlen( $args['s'] ) < 4 ) {
    $args['p'] = 1;
    }
    return $args;
    } );

    Best Regards

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.