ACF content not indexed/searched

Home Forums Product Support Forums Ajax Search Pro for WordPress Support ACF content not indexed/searched

This topic contains 26 replies, has 2 voices, and was last updated by BorisWebdesign BorisWebdesign 5 years ago.

Viewing 15 posts - 1 through 15 (of 27 total)
  • Author
    Posts
  • #21668
    BorisWebdesign
    BorisWebdesign
    Participant

    Hello,
    i just purchased the Ajax Search Pro WordPress plug-in. I recently asked you if it has support for ACF (Advanced Custom Fields), and the answer was yes. This is vital, as the website I am implementing it on, makes heavy use of ACF.

    So far, I have been unable to get the ACF fields content indexed and in the search results.

    I have tried to find these settings: LINK TO KB, but that setting is no longer present in the plugin settings.

    I’ve also tried by adding a code snippet to my functions.php, as suggested HERE, but that is also not helping. And even if it did, that would be a poor solution because I would need to manually add each repeater field.

    I did find an option to index custom fields via Index Table > General, but that also means adding each custom field manually. There is no option to just add every custom field.

    Can you help me fix this?

    I’ve supplied WP credentials, but please send me your public IP address first, so I can add it to the access list. The website is not public yet.

    Regards,
    Boris Hoekmeijer

    #21674
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Please note that repeater fields are not supported – every other ACF text based field is, exceptions are the repeaters, as those are not stored as textual values and those does not have any fixed content layout to parse. The only possible solution is that knowledge base article unfortunately.

    The ACF API does not have a way to get all repeater field subfieds to index, because of that there is no way for us to integrate a permanent solution. There is also no way to list only the repeater fields, which makes it even harder.

    Do you have by any chance a list of the fields to index, or do you simply vant to index all fields there are? Indexing all custom fields is not implemented on purpose, as parsing every custom field on a post can easily cause the index process to fail, as in some cases people have 1000s of fields per post, and PHP usually cannot handle that amount of data.

    Maybe I can suggest a modification to that code to index everything, let me know if that is what you want to try.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #21677
    BorisWebdesign
    BorisWebdesign
    Participant

    Hi Ernest,

    thanks for clarifying the problem. Yes, I have a list of fields I want to index:
    dagelijks,
    rvt,
    contact_gebouw,
    contact_adres,
    contact_email,
    contact_telefoon,
    contact_mobiel,
    links_alg_kop,
    links_alg,
    links_rc_kop,
    links_rc

    The list will still be expanded while I’m building, but once the custom fields are in place, there will not be many changes to them. And if there are, I will be the one making them. So if you can help me get that code snippet working with this list, that would certainly be good enough for me.

    Boris

    #21687
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thank you Boris.

    Okay, so based on the list, here is a modified version of that suggested code. Add this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!

    The newly created custom fields you can add to the $field_names variable. This should also handle non-relationship and non-repeater fields as well. The repeater sub-fields should be automatically converted to non-arrays. There is still a chance that this may not work, as repeaters and relationship fields does not have a fixed structure, but I think this is as close as it gets.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #21697
    BorisWebdesign
    BorisWebdesign
    Participant

    Hi Ernest,

    thanks very much. I added the script to functions.php. After that, I went to Index Table > Create new index.
    When I then go to the front-end and do a search for something I know is in one of those fields, it still comes up with zero results. Am I missing a step?

    #21700
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    That should do the trick, unless there is something I’m missing here. Are all of these fields repeater/relationship fields you listed?

    Can you please add temporary FTP details, I would like to debug through this code, maybe there is an error I didn’t notice. Also, I tried to log-in via the back-end details, but the URL is redirecting me to an empty page. Can you check that one as well? Thank you!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #21861
    BorisWebdesign
    BorisWebdesign
    Participant
    You cannot access this content.
    #21862
    BorisWebdesign
    BorisWebdesign
    Participant

    Please note that the custom code we’ve talked about is in inc/functions-custom.php from line 213 onward.

    #21872
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #21873
    BorisWebdesign
    BorisWebdesign
    Participant

    Hi Ernest,
    I’ve addded your IP. Let’s see how it goes. If it keeps changing, I’ll think of something else, but I don’t want to run the risk of Google indexing the site.

    #21879
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    That worked, thank you. There was a minor syntax error in the code, I have corrected that. Now I reindexed everything and tried a few phrases, and it seems to be returning results based on them.
    I tried searching “[email protected]” and “+31712001220”, which are on the Contact page, and it was returned as a result now. I’m not sure if it indexes everything everywhere, but it should be much more in depth now.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #21886
    BorisWebdesign
    BorisWebdesign
    Participant

    Hi,
    may I ask how you do a search then? I don’t know what is going wrong, but when I do a search in the sidebar, it should display the results on the page content next to it. It keeps displaying 0 results now, even when searching for terms that are in the regular post content field.

    #21890
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    You have an active date filter set, to restrict the results to a single day only: https://i.imgur.com/lGQsITn.png
    Make sure to either disable that, or change the filter values accordingly, that will resolve the issue. I was testing on a temporary search instance, I didn’t notice that, sorry.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #21895
    BorisWebdesign
    BorisWebdesign
    Participant

    Ah, thanks! But how can I include the option of filtering by date in the search options without activating it by default?

    #21904
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    You can set date based exclusions under the Advanced Options -> Exclude/include results panel: https://i.imgur.com/9XWYoDv.png

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 15 posts - 1 through 15 (of 27 total)

The topic ‘ACF content not indexed/searched’ is closed to new replies.