Get WPFTS Pro today with 25% discount!

Number of search results


  • Does WPFTS limit number of search results?
    I have set Settings>Read to 100 posts (in WP Admin)
    i have added to my child theme's functions.php:
    function change_wp_search_size($query) {
    if ( $query->is_search ) // Make sure it is a search page
    $query->query_vars['posts_per_page'] = 50; // Change 10 to the number of posts you would like to show
    return $query; // Return our modified query variables
    }
    add_filter('pre_get_posts', 'change_wp_search_size'); // Hook our custom function onto the request filter

    But i only get 5 results (always, for any keyword, even if there are more results)

    Kind regards, Marco


  • Hi @webwerkplaats

    No, WPFTS does not control this parameter.
    The reason why you don't see any changes may be because the code is wrong.
    Please try this code instead:

    add_action('pre_get_posts', function(&$query)
    {
        $query->set('posts_per_page', 50);
    });
    

    Notice: 'pre_get_posts' is an action , you don't need to return something from it.
    The parameter $query should be sent as reference (with &).

    Let me know if this helps.


  • I'm sorry, no, it doesn't help.
    This site is weird. I have made prototype on 1 server. Then copied it 1:1 to another server. There some links don't work. Previous page, Next page pagination and the Divi Theme builder only work when i set permalinks in Wordpress to "Simple". When i change permalinks to "Post Name" or any other, the site misbehaves. Can't figure it out. Maybe this is also the reason the site doesn't "listen" to my code or your code to expand the number of search results.
    Thanks for the help but it seems the error is not in your plugin.


  • Hi @webwerkplaats

    The Divi Builder has its own "Number of Posts" settings which overrides your code, I guess.

    E20210121-143835-001[1].png

    Did you try to change that?


  • i feel stupid now...YES! It works...

Suggested Topics

  • There are no results in the search

    Bugs and Fixes
    6
    0 Votes
    6 Posts
    161 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 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!

  • Unable to translate "Search" widget

    Bugs and Fixes
    3
    0 Votes
    3 Posts
    743 Views
    R

    I am using the Pro version. My registered email is : sita@cavernas.org.br

  • Sorting of Search Results

    Bugs and Fixes
    5
    0 Votes
    5 Posts
    1k Views
    N

    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.

  • Very slow search query on large wordpress site

    Bugs and Fixes
    13
    0 Votes
    13 Posts
    2k Views
    mazcabralM

    @EpsilonAdmin
    Great! but I still haven't received the email with the link. If possible, please send me back so that I can install and do the tests. Thank you so much!

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