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

    for some random reason, my SimpleSearch call can't seem to exclude articles from search results although I specify the containers in the call. I can easily restrict the search to a specific container by specifying it in the &id parameter, but excluding it with the &exclude parament doesn't affect the children.

    Here's the call

    [[!SimpleSearch? &exclude=`132,135,588` &tpl=`Tpl.Search.Results` &pageTpl=`Tpl.Search.Page` &perPage=`10` &pagingSeparator=`` ¤tPageTpl=`Tpl.Search.Page.Active` &containerTpl=`Tpl.Search.Container`]]


    It works just fine if I specify the articles individually, but we're talking hundreds of resources -- It's simple not efficient.

    Anyone?
      A MODx Fanatic
    • I think you'll want a posthook and "faceted" search. The posthook snippet in your case would have something about "WHERE parent NOT IN (list-of-Articles-container-IDs)"

      http://rtfm.modx.com/display/ADDON/SimpleSearch.Faceted+Search+Through+PostHooks
        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
        • 30585
        • 833 Posts
        Quote from: sottwell at Jan 07, 2013, 01:19 AM
        I think you'll want a posthook and "faceted" search. The posthook snippet in your case would have something about "WHERE parent NOT IN (list-of-Articles-container-IDs)"

        http://rtfm.modx.com/display/ADDON/SimpleSearch.Faceted+Search+Through+PostHooks

        Thx @sottwell -- I guess I'll have to spend some time on this. It'll be great if this functionality made it into future versions of SSearch.
          A MODx Fanatic