Get WPFTS Pro today with 25% discount!

Search word in a PDF


  • Hello @EpsilonAdmin

    I would like to make a research of words in a PDF in my website. I want to use the search tool to search the word the pdf file. Is it possible ?

    Is it possible to have the resultants of the research on the same page in the form of a table with the possibility of finding the word in the document by clicking on it?

    Thanks


  • Hi @juuulieeen

    The WPFTS Pro plugin is the tool to search posts and files by content. It does not intend to be used to search exact word position inside the file, because it's a very different task.

    But since the plugin extracts PDF content as the raw text, it's still possible to find word position in a file. Maybe I need to add some PHP code for this.

    Could you clarify or give me an example of which sort of search inside the PDF file you need? How the result should look?

    Thanks.


  • @epsilonadmin

    I would like to do a search for a word in a pdf file and that the result can be displayed on the same page (below the file) either in the form of a table or in the form of a list of annotations.

    Have a link between the document and the word found. For example being able to click on the word and find it directly in the file. Kind of like doing CTRL + F in a PDF file.

    Thank you.

Suggested Topics

  • How long should indexing take?

    General Discussion
    10
    0 Votes
    10 Posts
    1k Views
    EpsilonAdminE

    @paulf Hi, yes, please. You can put me a message directly to my email [hidden] also

  • Custom Directory

    General Discussion
    2
    0 Votes
    2 Posts
    554 Views
    EpsilonAdminE

    Hi @rgm_b

    Currently, the plugin works with the database, not with the physical location of the files. Actually, it does not matter where the file is stored - it will index all the files that are in WP Media Library.

    So the best way to index the folder with files - just to upload these files into the WP Media Library. Is it a problem to do that with your app?

  • Working with BuddyDrive ?

    General Discussion
    1
    0 Votes
    1 Posts
    459 Views
    No one has replied
  • Adding woocommerce SKU and taxonomy

    General Discussion
    2
    0 Votes
    2 Posts
    928 Views
    EpsilonAdminE

    Yes, it looks correct. I think there should be a better way to get taxonomy (using WP native methods). Also, I see a bit strange names for custom post meta names (MPN Number and MPN2 Number) - please be sure they are stored in a database like this exactly.

    You can check your hook using Sandbox / Test Index. Just put the product post ID into the input and press the button. It should show you all cluster values, including 'sku' and 'product taxonomy'. Next, you can go to Edit one product and press Update to force WPFTS to rebuild index for this product. After that, this product should become searchable by sku and taxonomy.

    If so, you can press Rebuild Index to rebuild an index for all products.

  • Include PDF's Uploaded via RCWD Upload

    General Discussion
    3
    0 Votes
    3 Posts
    705 Views
    EpsilonAdminE

    Hi, the idea is to use wpfts_index_post hook to extract the special meta-field (added by RCWD) value and index the file which is linked there.

    The working code is below.

    add_filter('wpfts_index_post', function($index, $post) { global $wpfts_core; if ($post && $wpfts_core && function_exists('get_field')) { if ($post->post_type == 'paper') { // You can change the post_type here $file = get_field('file', $post->ID); // You can change the ACF field name here if (isset($file['path']) && (strlen($file['path']) > 0)) { // Add a special library to work with file contents (included to WPFTS Pro) require_once $wpfts_core->root_dir.'/includes/wpfts_utils.class.php'; // This call will return extracted text from the FILE $ret = WPFTS_Utils::GetCachedFileContent_ByLocalLink($file['path'], false, true); // Store the content to separate index cluster (so we can apply different relevance weight to it, if required) $index['rcwd_file_content'] = isset($ret['post_content']) ? trim($ret['post_content']) : ''; } } } return $index; }, 3, 2);

    Looks not that hard?

    Also, you can download the ready addon plugin here.

    wpfts-addon-rcwd-uploader.zip

Be the first to read the news!

We are always improving our products, adding new functions and fixes. Subscribe now to be the first to get the updates and stay informed about our sales! We are not spammy. Seriously.

Join Us Now!

We are a professional IT-team. Many of us have been working in a Web IT field for more than 10 years. Our advanced experience of software development has been employed in the creation of the WordPress FullText Search plugin. All solutions implemented into the plugin have been used for 5 or more years in over 60 different web-projects.

We are looking forward to your comments, requests and suggestions in relation to the current plugin and future updates.

ewm-logo-450

The forum powered by NodeBB | Contributors