Get WPFTS Pro today with 25% discount!

Sorting of Search Results


  • Is there a way to modify the relevance sort weightings when applied to attachments, particularly pdfs, based upon the number of times the search term appears within the document? (i.e. the more often the term appears, the higher the relevance).


  • Hi @Nick

    It's a good task to think! Mainly the relevance calculation is based on the TF-IDF algorithm, which means the number of terms also divided by the length of the document, so we actually get not exactly the number of terms, but a terms density.

    However, the WPFTS is very flexible and I think the algorithm you need can be implemented with some code magic.

    Could you explain please why you need such an algorithm and how it exactly should be implemented?


  • Most of the documents we have on our website are pdfs of our Journals, that were originally paper copies going back to 1955. Each Journal typically contains 6 - 8 substantial articles of about 10 pages each, plus many shorter articles and including comments on earlier articles.
    So, the more times a search term is mentioned in an article and, particularly, if the term is included in the title of the article, the more likely it is that the article is specifically about the search term or something closely related to it.
    On the assumption that WPFTS can't tell where one article ends and another begins, the number of instances within the document would be a good proxy.


  • Okay @Nick

    So the main issue is that we can not extract separate articles from the PDF and assign more weight to their titles, correct?

    Your solution looks reasonable, and we can implement it. But before that, do you think we can try to extract separate articles from the PDF or (which is even simpler) extract article titles. We could store these titles into the separate index cluster and assign this cluster more weight. It could work even better than weighting relevance on a number of terms.

    Could you please send me one or two typical PDFs? It worth trying to extract titles from them using some heuristic algorithm.

    Also, could you tell me how much PDFs you have in total? Will it be a headache to extract titles manually?


  • We have over 1,000 pdf documents on our website, and the most important is our Journal, with 238 editions at present. As an example, a couple of issues of our Journal are here, but they are all similar in structure:
    https://rchs.org.uk/wp-content/uploads/2020/02/Journal-100-Nov-1975.pdf
    https://rchs.org.uk/wp-content/uploads/2020/02/Journal-001-Jan-1955.pdf
    You will see that at the bottom of the second page of Journal 100 is a table of contents for the issue and, if the pdf is saved and then opened in Acrobat Reader, there is an equivalent set of bookmarks. It would help if a search term appearing in the article title (as listed in the table of contents) was given a higher weighting than one in the text of the document, but quite often the term will only occur in the text, and not in the title at all.
    Ideally, we would like the weighting to be based upon articles, but weightings based upon the the whole Journal is acceptable. This is because the articles tend to be on unrelated topics within a Journal, so there is probably little difference between the number of instances of a specific search term within an article, and within its parent document.
    I think it would help me if you could explain, in non-technical terms, how the four weightings operate with WPFTS. I've looked at the TFIDF article on Wikipedia, and understand the basics, but the majority of the article is too technical for me. Perhaps this information could also be added to the WPFTS documentation?
    As a related issue, could WPFTS open the document listed in the search results at the first article page where the search term is found? I realise it might go to the article title instead, and if so that wouldn't really help much.

Suggested Topics

  • No valid search resulds, whats wrong?

    Bugs and Fixes
    10
    1 Votes
    10 Posts
    398 Views
    EpsilonAdminE

    Hi @stark

    Unfortunately, WPFTS does not work with PODS custom fields "from the box", so custom code exists somewhere. I think your developer used another way to add data to the search index.

    We need to ask him or alternatively, I could check your code myself, it should not be too long. In this case please send me admin access to your resource using a private message.

    Thanks.

  • Link URL showing up in search results.

    Bugs and Fixes
    6
    0 Votes
    6 Posts
    254 Views
    EpsilonAdminE

    Hi @jgregory_ca

    Okay, the fix for Avada addon should be ready in a couple of days. Just FYI.

    Thanks!

  • There are no results in the search

    Bugs and Fixes
    6
    0 Votes
    6 Posts
    213 Views
    EpsilonAdminE

    This bug (definitely a bug!) was fixed in version 1.68.232
    We made "ident" field in the new wpftsi_irules table shorter (limited from 255 to 130) to avoid VARCHAR index length overflow.

    Thanks, @lostconcerts !

  • Search working only when logged-in

    Bugs and Fixes
    1
    0 Votes
    1 Posts
    301 Views
    No one has replied
  • Search Engine status remains awaiting

    Bugs and Fixes
    10
    0 Votes
    10 Posts
    1k Views
    EpsilonAdminE

    Hi @davide-merlitti

    It happens because you have problems with wp-cron tasks or DNS configuration.

    If you have your website hosted locally, often the domain name is just recorded in /etc/hosts file. This is normally okay for browser access (and this is why indexing is coming well but slow when your WP admin is open). But PHP can not read /etc/hosts by some reason and thus indexing procedure can not go internally.

    Please read this solution and try it.

    Please let me know if it helps or not.

    Thanks!

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