We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17007
    • 1 Posts
    Hi,

    I have a document structure that has documents containers as categories (ex. PHP, MySQL, CMS, ...) and for each category I have child documents. If the user is browsing category "PHP", when he search he should see only results in this category, I don’t want he get results about other topics that "PHP". I get that solved using "parents" parameter in the snippet call and setting the &parents=`[+categoryid+]`, where [+categoryid+] is a placeholder that contains the id for the current document category. The problem appear when the category doesn’t contains any child documents, and then the results include all public docs in the whole site, instead say "No search results" that would be the right in this case.

    I’m missing a parameter in my call to ensure this behavior?

    Regards,
    Lester
      • 5811
      • 1,717 Posts
      Hi lester,

      Thanks for your first post; You got a new issue. To solve it replace in the file assets/snippets/ajaxSearch/classes/search.class.inc.php, the line 1344:
              $this->listIDs = implode(',',$this->getChildIDs($arrayIDs, $depth));
      by:
              $this->listIDs = implode(',',$this->getChildIDs($arrayIDs, $depth));
              if (!($this->listIDs)) {
                $this->listIDs = '999999';
                return;
              }
      This issue (and the current fix) is now registered as AJAXSEARCH-44