Forums Forums Search & Filter Pro Post Meta Wildcard

Viewing 10 posts - 1 through 10 (of 11 total)
  • Trevor
    #65469
    This reply has been marked as private.
    Anonymous
    #65471
    This reply has been marked as private.
    Trevor
    #65518

    It depends on how you migrated the site. Search and Filter is quite sensitive and often a mysql dump will not do it right.

    This may be the issue though:

    Search and Filter Pro only correctly supports/searches/filters/caches simple ACF fields. The next version that we release will extend that support to ‘relationship’ fields. However, repeater fields are incredibly complex and difficult to support. It is out intention to further extend our support in future editions, but that may be a while away.

    I do not know if there is a different way that you can structure the data (probably not as neat as the repeater field is)?

    Anonymous
    #65534

    Hi Trevor,

    Dont worry re the mysql dump – i did it that way so as to be quick so you can have a look at the setup.

    Re the repeater fields, i understand they are very complex. However an idea as i said is to put a wildcard where the user would be able to type in the variable name (e.g. in my case address_%_area) and next to it, tick a box LIKE. this way in the SQL, it would generate something like

    ‘WHERE meta_key LIKE ‘address_%_area’

    This will then return all the values under for all the repeater fields, like address_0_area, address_1_area, address_2_area etc.

    Would you please be able to point me in the right direction to the file where the SQL for post_meta is is being generated maybe i can have a go at it? ๐Ÿ™‚

    Cheers ๐Ÿ™‚

    Trevor
    #65542
    This reply has been marked as private.
    Anonymous
    #65552

    Ah, yes, perhaps the area where it queries the cache for the post_meta types …

    Thanks – much appreciated!

    Ross Moderator
    #66054

    Hey Fernand

    Just to warn you wildcard searches can be very very slow, which is why we haven’t gone down that route within the plugin itself, or made it available…

    Anyway, the way S&F is setup I think it would be very difficult to modify the behaviour.

    I’ll try to explain.

    S&F doesn’t do one big expensive query using lots of joins to fetch the results.

    What it does is, it creates 2 tables in your setup.

    First is a flat table with your taxonomy and meta data (search_filter_cache)..

    Then S&F uses this table to build another – search_filter_term_results, this basically stores the IDs against every option of the the fields in your search forms.

    So, in order to change the type of query as you mention, you would first need to change how S&F caches the posts.. specifically how it creates the values in the second table…

    In addition to that, S&F has never supported repeater fields (its on the todo list), but essentially I don’t think S&F is actually able to index the data from repeater fields at all, so before you think about wildcard searches, I don’t think S&F can support repeater fields whatsoever in its current form…

    If you did want to go diving in, the file you would need to modify is search-filter-pro/includes/search-filter-post-cache.php

    Then the function which is run to update the cache for a particular post is update_post_cache… the function you would actually want to modify is:

    get_cache_term_ids

    Here you can find the SQL used to query first table I mentioned above (which then builds the values in the second table), which is where your wildcard stuff would need to go…

    All in all, I think to do what you want would be extremely difficult.

    Thanks

    Anonymous
    #66545
    This reply has been marked as private.
    Trevor
    #66547
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 11 total)