Search returns results for empty search term when opened

Technical Support
  • I have enabled search button in navigation only for admins. When I click on button I get redirected to /search and it also returns search results for empty term - "".

    I've tried uninstalling and installing dbsearch plugin, restarted NodeBB and behavior is still the same.
    This bug occurs only on production, I have same settings on testing forum and it works properly. I'm using version 1.1.2.

    I have some custom CSS and following changes made both on testing and production sites:


    2. /nodebb/src/controllers/search.js file:

    3. Custom header:

    $(window).on('action:ajaxify.contentLoaded', function(){
      $('.page-category-480 [component="category/post"]').text('Click here to ask a question')
    $(window).on('action:composer.loaded', function(event, data){
      // Get the composer elements.
      var comp = $('#cmp-uuid-' + data.post_uuid);
      var catlist = comp.find('.category-list');
      var title = comp.find('input.title');
      if (catlist.length) { // If there's no catlist, then the post is a reply.
        var defaultPlaceholder = title.attr("placeholder");
        // Update the placeholder if category is 480, else set it to the default.
        function updatePlaceholder() {
          if (catlist.val() === '480') {
            title.attr("placeholder", "Ask a question");
          } else {
            title.attr("placeholder", defaultPlaceholder);
        // Update placeholder each time the category changes, and once when loaded.
    $(document).ready(function() {
        $(window).on('action:ajaxify.end', function(ev, data) {
            $('.page-search #advanced-search button[type="submit"]').clone(true).appendTo('');

    Is there any existing cache for search terms? Perhaps hasn't been cleared properly? Otherwise I'm out if ideas what could be causing this kind of behavior.

  • @metalkramp is your site available to test? It's easier to debug directly.

  • Opening search seems to be searching for "" when using the nodebb-plugin-dbsearch plugin. Can't replicate on this community as solr plugin is used here instead.

  • Due to problems with dbsearch plugin mentioned above I switched to solr plugin. Seems to resolve problems that occured with dbsearch + solr gives better search results.

Suggested Topics

  • 0 Votes
    8 Posts

    Here you go.
    After i slept on it, i changed position of hook so it works for both "delay loading" turned on and off. Original place was working only for delay loading turned on so it needed one more hook inside "unloadImages" function and i prefer solutions with less code.

  • Empty Homepage

    Technical Support
    0 Votes
    8 Posts

    Thanks, it looks like I'm back up and running. ✨

  • 0 Votes
    4 Posts


    The solution I've found for this problem is to run the following command inside the NodeBB installation folder

    git cherry-pick 1f3fa3a90f5fc02b3b2dc950b3a340c361206cef

    Doing so automatically merges the fixing commit without any further problems, making the Admin panel usable instantly after a NodeBB restart 🙂

  • 0 Votes
    1 Posts

    Hello and thanks for a great forum software!

    I've been playing with a docker hosted nodeBB instance, but all I'm getting from the docker hub is a v0.5 of NodeBB. Is there any reason the docker hub has such an old version? Can I avoid this somehow?


  • 0 Votes
    3 Posts

    Thanks for that. I would expect some way to configure that. Removing that line would also apply that to all widgets areas, on all themes, right?

    My workaround is to add a plznohide class to the appropriate widget areas' divs and add this to either my theme CSS or the "Custom CSS":

    .hidden.plznohide { display: initial !important; visibility: visible !important; }

    It seems to work as expected. Being able to configure if each widget area should be hidden in the ACP would still be nice.