• Resolved tgaff2x

    (@tgaff2x)


    I want to index PDFs whereby I will have:
    1. Toolset to create a custom document type
    2. Within the custom document, I will have the normal post and an attachment of a PDF

    When the item is found in the search results, and the user clicks on a link, I do NOT want the user to go direct to the post page.

    Instead, I want the user to go to a page such as redirect/?doc_id=$post_id

    Is there an option to change the post_url that is displayed on search results? Should I look a overriding the get_post_url function?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author WPSolr free

    (@wpsolr)

    When the item is found in the search results

    The item will not be found by the content of it’s PDF. WPSOLR only indexes post attachments stored in the media library, not attachments linked to a post.
    WPSOLR PRO offers this kind of ’embedded’ file extensions for ACF PRO, Embed Any Document, PDF Embedder, Google Doc Embedder, but not for Toolset yet.

    Is there an option to change the post_url that is displayed on search results?

    Select your own theme search template in screen 2.1, instead of WPSOLR default Ajax search template. You can then do whatever you want with your results.

    • This reply was modified 7 years, 3 months ago by WPSolr free.
    • This reply was modified 7 years, 3 months ago by WPSolr free.
    • This reply was modified 7 years, 3 months ago by WPSolr free.
    Thread Starter tgaff2x

    (@tgaff2x)

    OK, thanks. I think this part may be problematic for me “The item will not be found by the content of it’s PDF. WPSOLR only indexes post attachments stored in the media library, not attachments linked to a post.”

    Is there a way to index an attached pdf and have the post found?

    Plugin Author WPSolr free

    (@wpsolr)

    It’s done in some extensions of WSOLR PRO, with our core actions/events. So, yes, it is possible.

    https://www.wpsolr.com/guide-category/actions-and-filters/

    Thread Starter tgaff2x

    (@tgaff2x)

    regarding “Is there an option to change the post_url that is displayed on search results?”

    is it also possible to use
    WpSolrFilters::WPSOLR_ACTION_POSTS_RESULTS

    I tried a quick
    add_action( WpSolrFilters::WPSOLR_ACTION_POSTS_RESULTS, ‘wpsolr_action_modify_post_url’,
    10, 1 );

    but my function wasn’t getting called. not even sure if this path is worth pursuing.
    https://www.wpsolr.com/guide/actions-and-filters/search-results-modify-posts/

    Plugin Author WPSolr free

    (@wpsolr)

    Just change your theme’s search template, to insert the link to your content file instead of the post.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom post_url’ is closed to new replies.