Search PDF from ACF Field Embed Content

  • 1 year, 7 months ago #32928

    Hi,
    I have checked the embed any document documentation for pdf, its working when I embed pdf within the content, but I need to use the pdf from a custom acf file. Can we able to do this ?
    Image image.png of Search PDF from ACF Field Embed Content

    Same embed code if I use within content body and tick this option, its working.. and its searchable in search results.

    Image image.png of Search PDF from ACF Field Embed Content

    wpsolr
    Keymaster
    1 year, 7 months ago #32929
    1 year, 7 months ago #32930

    I only want to index a certain field, which has the pdf url.. not all acf fields..

    wpsolr
    Keymaster
    1 year, 7 months ago #32931

    Unselect the “Index all ACF file fields”, then use the hook WPSOLR_Events::WPSOLR_FILTER_GET_POST_ATTACHMENTS to control which field you want to index.

    You can find a functional code example in /wpsolr-pro/wpsolr/pro/extensions/acf/class-wpsolr-plugin-acf.php
    The code browses all ACF file fields of the post, but you can filter with the field you need.

    1 year, 7 months ago #32958

    Thank you, working fine with this filter.

    1 year, 7 months ago #32959

    How to show the matched words or lines in description, as currently theme search template is showing normal post content. how do we make it dynamic to show content from the matched file ?

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.