We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13428 ☆ A M B ☆
    • 1,031 Posts
    &parents=`not in:64,84` is the better option for sure, because this will create a where clause in ajaxSearch that will narrow the result array during request.

    &filter=`parent,64,2|parent,84,2` is a high level function that filters the result array after the request.

      • 20413
      • 2,877 Posts
      I tested (in order to see if mysql would load slower [^qt^] )
      'displayed' => array('*'),


      It didn't load slower! But...

      ...it broke the search results. All titles disappeared!? shocked

      However adding parent to the array works...

      // I have some reading to do... tongue
      http://www.mysqlperformanceblog.com/2013/10/22/the-power-of-mysqls-group_concat/ [ed. note: mrhaw last edited this post 12 years, 3 months ago.]
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 13428 ☆ A M B ☆
        • 1,031 Posts
        O.k. Line 683 in ajaxSearchOutput.class.inc.php causes the disappearing.

        In my opinion the documentation should be expanded with the fields that could be used for filtering.
          • 21417
          • 486 Posts
          Thanks for all the testing and input everyone.

          I am a bit late to the party...

          Quote from: mrhaw at Jun 28, 2014, 04:48 PM
          Ok...

          Had no luck with &filter seems like it doesn't see the parent of the resource.

          But this works:

          AjaxSearch snippet call on search page:
          [!AjaxSearch? 
          ...
          &parents=`not in:64,84`
          ...
          !]

          &parents=`not in:64,84` works for me too!! That is wonderful, thanks. I did not know about that parameter.

          For anyone who is interested, my final AjaxSearch snippet call on search page is now:
          [!AjaxSearch? &showInputForm=`0` &ajaxSearch=`0` &showIntro=`0` &pagingType=`0` &highlightResult=`0` &grabMax=`20` &minChars=`2` &rank=`pagetitle:80,introtext:60,description:40` &whereSearch=`content:null` &advSearch=`oneword`
          &parents=`not in:64,84`
          &tplInput=`as-tpl-searchboxP`
          &tplGrpResult=`as-tpl-grpResult`
          &tplResult=`as-tpl-result`
          &tplResults=`as-tpl-results`
          &tplPaging0=`as-tpl-paging0`
          !]


          Quote from: mrhaw at Jun 28, 2014, 04:48 PM

          // + As you use front-end pubKit you could also go the route of creating resources with searchable off.

          $fields = array(
              "searchable" => 0,
          Thanks for this suggestion also. I am not sure if that is feasible because the resources should to be searchable when they are published to the main folder on approval from the staff. I think &parents=`not in:64,84` overcomes the problem for now. Many thanks.
            Web design Adelaide
            http://gocreate.com.au
            • 21417
            • 486 Posts
            Thanks for the testing Keith.
            Quote from: kp52 at Jun 29, 2014, 04:48 AM
            Re setting Searchable off when creating PubKit items - a good idea for previews, and should be possible to build in in a similar way to the &showinmenu setting. Some code adjustment is needed to switch searchability back on when you publish an item, of course, unless you specify otherwise via the new parameter.
            Sounds great Keith, I can see how this would come in handy.
            &parents=`not in:64,84` seems to work in this instance though.

            @kp52: The hideMenu problem is not caused by this. It should work as as expected.
            I experience the same problem Jako - putting hidemenu directly in the snippet call does not seem to have any effect in my testing.


            &parents=`not in:64,84` is the better option for sure, because this will create a where clause in ajaxSearch that will narrow the result array during request.
            Thanks Jako, that is what I will use for this. [ed. note: nickf08 last edited this post 12 years, 3 months ago.]
              Web design Adelaide
              http://gocreate.com.au
              • 21417
              • 486 Posts
              It would be nice to have something like this is ditto too...
              &parents=`not in:64,84` [ed. note: nickf08 last edited this post 12 years, 3 months ago.]
                Web design Adelaide
                http://gocreate.com.au
                • 13428 ☆ A M B ☆
                • 1,031 Posts
                Try:
                &where=`parent NOT IN (64,84)`
                  • 13428 ☆ A M B ☆
                  • 1,031 Posts
                  Quote from: nickf08 at Jul 01, 2014, 04:36 AM
                  @kp52: The hideMenu problem is not caused by this. It should work as as expected.
                  I experience the same problem Jako - putting hidemenu directly in the snippet call does not seem to have any effect in my testing.
                  Try to change line 243 in snippet.ajaxSearch.php
                  $cfg['hideMenu'] = isset($hideMenu) ? intval($hideMenu) : (isset($__hideMenu) ? intval($__hideMenu) : $dcfg['hideMenu']);

                    • 21417
                    • 486 Posts
                    Quote from: Jako at Jul 01, 2014, 05:40 AM
                    Try:
                    &where=`parent NOT IN (64,84)`
                    Hey Jako, You are a genius.
                    That works great in Ditto.
                    Thanks!
                      Web design Adelaide
                      http://gocreate.com.au
                      • 21417
                      • 486 Posts
                      Quote from: Jako at Jul 01, 2014, 05:52 AM
                      Quote from: nickf08 at Jul 01, 2014, 04:36 AM
                      @kp52: The hideMenu problem is not caused by this. It should work as as expected.
                      I experience the same problem Jako - putting hidemenu directly in the snippet call does not seem to have any effect in my testing.
                      Try to change line 243 in snippet.ajaxSearch.php
                      $cfg['hideMenu'] = isset($hideMenu) ? intval($hideMenu) : (isset($__hideMenu) ? intval($__hideMenu) : $dcfg['hideMenu']);

                      Thanks Jako.
                      Making that change to line 243 in snippet.ajaxSearch.php fixes the snippet call: &hideMenu=`0` works as expected then - as does &hideMenu=`1` and &hideMenu=`2`.
                      Many thanks.
                      Can that be added to the next version of Evo?
                        Web design Adelaide
                        http://gocreate.com.au