We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49438
    • 8 Posts
    I am using SimpleSearch for the search in my website. At the moment, it spits out the searched content in long list. I am trying to categorise my search results. For e.g. first it should search in one container and then another and so on. I tried doing something like:

    [[simpleSearch? &ids`100,50,25`]]


    What I wanted was the search should look for results in container id 100 and then 50 and then 25. But it doesn't seem to be working. Is there something which I am doing wrong here? New to MODx so haven't really had much time to play around with different options. Any help would be much appreaciated! Thanks
      • 42562
      • 1,145 Posts
      donshakespeare Reply #2, 9 years ago
      Thou art missing an equals sign(=), and I would uncache that snippet call (!)

      Try something like
      [[!simpleSearch? &ids=`100,50,25`]]
        TinymceWrapper: Complete back/frontend content solution.
        Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
        5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
        • 49438
        • 8 Posts
        Quote from: donshakespeare at Apr 22, 2015, 02:09 AM
        Thou art missing an equals sign(=), and I would uncache that snippet call (!)

        Try something like
        [[!simpleSearch? &ids=`100,50,25`]]

        Thank you Don. I did actually use the equals sign as well as the snippet call, but didn't copy and paste the code here.(Silly me) My actual snippet call is :

        [[!simpleSearch? &ids=`100,50,25`]]


        Whilst it does restrict my search to these three containers but doesn't display the results in that order. Any idea?
          • 22840
          • 1,572 Posts
          simpleSearch doesn't care where the resource is in the tree, it just outputs the results based on relevance and score of the word(s) searched for, I don't think you will be able to output it based on the parent, when you use &ids=`100,50,25` your just telling it where it is allowed to seach not how to filter them.

          You may be able to do something with the fieldPotency so that they list in the order required though https://github.com/splittingred/SimpleSearch/pull/29

          http://rtfm.modx.com/extras/revo/simplesearch/simplesearch.simplesearch