How to get the ACF field where the search pattern was found into
- mdruilheParticipant3 years, 1 month ago #25291
Hello,
I have a custom post type with the following structure :
- titre - date - ../.. - presentations (repeater) - titre - resume - auteur - fichier - ../..
I would like to get the ACF field into which the search was found.
Currently I get the post content, with the post_excerpt set to the extract containing the term found, but the content is not properly highlighted and it is not easy for the user to find where the term was found.
I can loop other the ACF structure, then check each field / subfield to find the pattern, but I also could do it w/o WPSOLR.
Is there a way (hook, filter) to do so ?
Thanks in advance for your help.
MarcmdruilheParticipant3 years, 1 month ago #25297Also, unless I miss some thing, it seems that the post excerpt doesn’t limit to the subfield contents but returns a string across several subfields.
eg: I have the following contents:Lieu: Paris Date: 9 mars 2021 Conferences: Titre : Test recherche sous-champ ACF Résumé: Ceci est un test de wpsolr avec ACF
A search on “ACF” returns the following excerpt :
. 1615342860000. Paris. Ceci est un test de wpsolr avec ACF . Test recherche sous-champ ACF...
I would expect : “Ceci est un test de wpsolr avec ACF”
Thanks in advance for your help
Marc
You must be logged in to reply to this topic.