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

    I’m using the ajaxsearch on a site and I need to exclude 3 documents from the results. The code I’ve tried is as follows but doesn’t seem to exclude them.

    [!AjaxSearch? &ajaxSearch=`0` &AS_showForm=`0` &documents=`10,58,59`!] 


    Can any one see where I’m going wrong ??

    Thanks
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The best way to exclude documents from a search is to edit the document itself and clear the "searchable" checkbox.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 22840
        • 1,572 Posts
        LOL laugh

        That easy hey.

        Thanks wink
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Looking at the snippet docs, I noticed a &filter parameter; the IDs (comma separated) you put in that parameter will be excluded from the search.

          This would be useful if you have different sections to your site, and only want certain pages searched when using different snippet calls for the different sections. So in that case, using the document’s settings wouldn’t be useful.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org