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

    Everything worked fine, and few days ago I tried to search and my "results" page only showed a blank page.
    I went back to ajaxSearch with only the minimum parameters, and everything went to normal.
    I tried every argument one by one, and when I use &parents the problem comes back.

    Here is the code I used with the problem :
    [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`116` &tplLayout=`optionSearch` &parents=`34,42,45` &depth=`5`!]


    and the landing page :
    [!AjaxSearch? &AS_showForm=`0` &ajaxSearch=`0` &grabMax=`30` &order=`publishedon DESC` &formatDate=`d/m/y` &tplResults=`searchResults` &tplResult=`searchResult` &tplPaging=`searchPaging`!]


    When I remove the &parents it works great.

    Can anyone help me ?

    (sorry for my english undecided)
      • 5811
      • 1,717 Posts
      Are you sure that the search term is somewhere in the children documents of 34,42,45.
      If you would like include the documents 34,42,45, use the "father" document of these documents.
          &parents [comma-separated list of integers  MODx document IDs] (optional)
              A list of parent-documents whose descendants you want searched to &depth depth when searching. 
              All parent-documents by default
      Otherwise, on your landing page, you need to add &parents=`34,42,45` too, if you would like restrict the search.
        • 19119
        • 22 Posts
        Thanks a lot for the answer smiley

        Actually the search term must be in the documents where the parents documents are 34,42,45.

        For example, my web site is like this :
        - Home (id 1, Not Searchable)
        - Blog (id 2, Not Searchable)
        - Fish (id 34, Not Searchable)
          + 2007 (Not Searchable)
           |- Document n°1 (Searchable)
           |- Document n°2 (Searchable)
           |- ...
          + 2008 (Not Searchable)
           |- Document n°1 (Searchable)
           |- Document n°2 (Searchable)
           |- ...
        - Cats (id 42, Not Searchable)
          + 2008 (Not Searchable)
           |- Document n°1 (Searchable)
           |- Document n°2 (Searchable)
           |- ...
        - Dogs (id 45, Not Searchable)
          + 2007 (Not Searchable)
           |- Document n°1 (Searchable)
           |- Document n°2 (Searchable)
           |- ...
          + 2008 (Not Searchable)
           |- Document n°1 (Searchable)
           |- Document n°2 (Searchable)
           |- ...


        And when a user search on the web site, I don’t want them to have results from "blog" or "home" only from directories 34, 42 and 45.

        Otherwise, on your landing page, you need to add &parents=`34,42,45` too, if you would like restrict the search.

        I’m going to try, thanks smiley

        Edit : I just tried to add &parents=`34,42,45` on the call to ajaxSearch (to display the search form) and on the landing page, and I still have the same blank page sad

        I’m running on Windows server 2003, with Wampserver 2.0 (PHP 5.2.9-1, Apache 2.2.11, MySQL 5.1.32), MODx 0.9.6.3 rev 4565, AjaxSearch 1.8.1 (if it can help wink )
          • 5811
          • 1,717 Posts
          Could you add
          $__debug = 3;
          in your configuration file (by default : configs/default.config.php) and send me by email the file snippets/ajaxSearch/ajaxSearch_log.txt generated after a search.

          In this file you could find the SELECT statement used and check why it doesn’t find nothing. Use the sql statement with phpMyAdmin for instance.

          My email is in my signature (on the left).
            • 19119
            • 22 Posts
            English version :
            Hello,

            I tried again to make it work, with the &parents parameter. I tried several parameter like &parents=`34,42,45` or with sub-directories contained in directories 34, 35 and 45 &parents=`35,36,37,38` but it still doesn’t work. I tried with only one directory like &parents=`34` but didn’t work either. I finally tried with only one sub-directory like &parents=`35` and i finaly got results, but I want to search in 3 differents directory.

            I made it work, I configured all the documents and directory "not serchable" and only the document contained in the 3 directories "searchable", so without using &parents it was working. But I now have to make another search form for only one directory which is a new one.

            Can anyone help me please huh

            Sorry for my english.

            Version française :
            Ca sera plus simple d’expliquer en français si jamais quelqu’un passe par là.

            Je me suis de nouveau intéressé à mon problème avec le paramètre &parents, en reprenant l’architecture de mon application dans mon premier post, jusque là je limitais la recherche à 3 dossiers qui contenaient tous les sous dossiers (eux même contenant les fichiers rechercheable). J’ai ensuite essayé de mettre dans &parents tous les sous dossiers de ces 3 dossiers. Cela n’a rien changé à mon problème, lorsque je valide le formulaire de recherche, j’arrive sur la page de résultats mais elle n’a aucun contenu (page blanche sans code HTML).

            J’ai essayé avec seulement un des 3 dossiers dans &parents, en me disant que ça pouvait venir de la liste de valeur, et cela ne marche toujours pas. J’ai finit par essayer avec un seul sous dossiers des 3 dossiers, et là ma recherche marche, mais ce qui m’intéresse c’est de pouvoir rechercher dans les 3 dossiers.

            Jusque là j’avais réussi à faire fonctionner ma recherche en spécifiant à toutes mes pages qu’elles n’étaient pas rechercheable, puis en spécifiant juste aux pages contenu dans les 3 dossiers qu’elles étaient rechercheable. Le problème c’est que j’ai besoin de créer un nouveau formulaire de recherche pour une dossier contenant des news qui est en dehors des 3 fameux dossiers, et je ne voudrais pas que lors d’un recherche dans les 3 fameux dossiers je trouve des résultats de l’autre dossier.

            Je ne sais pas si je suis bien clair undecided

            Merci d’avance smiley
              • 5811
              • 1,717 Posts
              Mephissto, I have set up a site with your document tree and I can’t reproduce your issue.

              Have you done a simple test with:
              [!AjaxSearch? &AS_showForm=`0` &debug=`3` &ajaxSearch=`0` &grabMax=`30` &order=`publishedon DESC` &parents=`34,42,45` &depth=`5` &formatDate=`d/m/y`!]
              Without using any tpls ?
              If your templates are not correctly defined, the output could be wrong.

                • 19119
                • 22 Posts
                Hello,

                I’ve tried with no Tpl, and the problem is still the same.
                Call to display the search form :
                [!AjaxSearch? &ajaxSearch=`0` &parents=`34,42,45` &debug=`3` &depth=`5` &AS_landing=`116`  &order=`publishedon DESC`!]

                Call on the landing page :
                [!AjaxSearch? &AS_showForm=`0` &parents=`34,42,45` &depth=`5` &ajaxSearch=`0` &debug=`3` &grabMax=`30` &order=`publishedon DESC` &formatDate=`d/m/y`!]


                Also, I’m using 4 or 5 template, and I created a chunk to display the same search form on each templates.

                Here is the ajaxSearch_log.txt :

                [20-May-09 10:01:14]  AjaxSearch  - Php5.2.9-1 - MySql 5.1.32-community-log
                [20-May-09 10:01:14]  AjaxSearch - User configuration - Before parameter checking : Array
                (
                    [config] => 
                    [debug] => 3
                    [language] => francais-utf8
                    [ajaxSearch] => 0
                    [advSearch] => oneword
                    [whereSearch] => content|tv
                    [subSearch] => 5,1
                    [withTvs] => 
                    [order] => publishedon DESC
                    [rank] => pagetitle:100,extract
                    [maxWords] => 5
                    [minChars] => 3
                    [AS_showForm] => 1
                    [resultsPage] => 0
                    [grabMax] => 10
                    [extract] => 1:content,description,introtext,tv_value
                    [extractLength] => 200
                    [extractEllips] => ...
                    [extractSeparator] => <br />
                    [formatDate] => d/m/y : H:i:s
                    [highlightResult] => 1
                    [pageLinkSeparator] =>  | 
                    [showPagingAlways] => 0
                    [AS_landing] => 116
                    [AS_showResults] => 1
                    [parents] => 34,42,45
                    [documents] => 
                    [depth] => 5
                    [hideMenu] => 2
                    [hideLink] => 1
                    [filter] => 
                    [tplLayout] => @FILE:assets/snippets/ajaxSearch/templates/layout.tpl.html
                    [tplResults] => @FILE:assets/snippets/ajaxSearch/templates/results.tpl.html
                    [tplResult] => @FILE:assets/snippets/ajaxSearch/templates/result.tpl.html
                    [tplComment] => @FILE:assets/snippets/ajaxSearch/templates/comment.tpl.html
                    [tplPaging] => @FILE:assets/snippets/ajaxSearch/templates/paging.tpl.html
                    [stripInput] => defaultStripInput
                    [stripOutput] => defaultStripOutput
                    [searchWordList] => 
                    [breadcrumbs] => 
                    [tvPhx] => 
                    [clearDefault] => 0
                    [jsClearDefault] => assets/snippets/ajaxSearch/js/clearDefault.js
                    [mbstring] => 1
                    [asLog] => 0:0:200
                )
                
                [20-May-09 10:01:14]  AjaxSearch - Search string : 2009/106
                [20-May-09 10:01:14]  AjaxSearch - Snippet call : [!AjaxSearch?  &debug=`3` &ajaxSearch=`0` &order=`publishedon DESC` &AS_landing=`116` &parents=`34,42,45` &depth=`5`!]
                [20-May-09 10:01:14]  AjaxSearch - tplResult template @FILE:assets/snippets/ajaxSearch/templates/result.tpl.html : <div class="[+as.resultClass+]">
                  <a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.longtitle+]">[+as.pagetitle+]</a>
                [+as.descriptionShow:is=`1`:then=`
                  <span class="[+as.descriptionClass+]">[+as.description+]</span>
                `+]
                [+as.extractShow:is=`1`:then=`
                  <div class="[+as.extractClass+]"><p>[+as.extract+]</p></div>
                `+]
                [+as.breadcrumbsShow:is=`1`:then=`
                  <span class="[+as.breadcrumbsClass+]">[+as.breadcrumbs+]</span>
                `+]
                </div>
                [20-May-09 10:01:14]  AjaxSearch - tplResults template@FILE:assets/snippets/ajaxSearch/templates/results.tpl.html : [+as.noResults:is=`1`:then=`
                  <div class="[+as.noResultClass+]">
                    [+as.noResultText+]
                  </div>
                `:else=`
                  <p class="ajaxSearch_resultsInfo">[+as.resultInfoText+]</p>
                  [+as.paging+]
                  [+as.listResults+]
                  [+as.paging+]
                `+]
                [+as.showCmt:is=`1`:then=`
                [+as.comment+]
                `+]
                [20-May-09 10:01:14]  AjaxSearch - tplResult template@FILE:assets/snippets/ajaxSearch/templates/layout.tpl.html : [+as.showForm:is=`1`:then=`
                <form [+as.formId+] action="[+as.formAction+]" method="post">
                    <fieldset>
                    <input type="hidden" name="advSearch" value="[+as.advSearch+]" />
                    <label for="ajaxSearch_input">
                      <input id="ajaxSearch_input" class="cleardefault" type="text" name="search" value="[+as.inputValue+]"[+as.inputOptions+] />
                    </label>
                    <label for="ajaxSearch_submit">
                      <input id="ajaxSearch_submit" type="submit" name="sub" value="[+as.submitText+]" />
                    </label>
                    </fieldset>
                </form>
                `+]
                [+as.showIntro:is=`1`:then=`
                <p class="ajaxSearch_intro" id="ajaxSearch_intro">[+as.introMessage+]</p>
                `+]
                [+as.showResults:is=`1`:then=`
                [+as.results+]
                `+]
                [20-May-09 10:01:14]  AjaxSearch - User configuration - Before doSearch : Array
                (
                    [config] => 
                    [debug] => 3
                    [language] => francais-utf8
                    [ajaxSearch] => 0
                    [advSearch] => oneword
                    [whereSearch] => content|tv
                    [subSearch] => 5,1
                    [withTvs] => 
                    [order] => publishedon DESC
                    [rank] => pagetitle:100,extract
                    [maxWords] => 5
                    [minChars] => 3
                    [AS_showForm] => 1
                    [resultsPage] => 0
                    [grabMax] => 10
                    [extract] => 1:content,description,introtext,tv_value
                    [extractLength] => 200
                    [extractEllips] => ...
                    [extractSeparator] => <br />
                    [formatDate] => d/m/y : H:i:s
                    [highlightResult] => 1
                    [pageLinkSeparator] =>  | 
                    [showPagingAlways] => 0
                    [AS_landing] => 116
                    [AS_showResults] => 1
                    [parents] => 34,42,45
                    [documents] => 
                    [depth] => 5
                    [hideMenu] => 2
                    [hideLink] => 1
                    [filter] => 
                    [tplLayout] => @FILE:assets/snippets/ajaxSearch/templates/layout.tpl.html
                    [tplResults] => @FILE:assets/snippets/ajaxSearch/templates/results.tpl.html
                    [tplResult] => @FILE:assets/snippets/ajaxSearch/templates/result.tpl.html
                    [tplComment] => @FILE:assets/snippets/ajaxSearch/templates/comment.tpl.html
                    [tplPaging] => @FILE:assets/snippets/ajaxSearch/templates/paging.tpl.html
                    [stripInput] => defaultStripInput
                    [stripOutput] => defaultStripOutput
                    [searchWordList] => 
                    [breadcrumbs] => 
                    [tvPhx] => 
                    [clearDefault] => 0
                    [jsClearDefault] => assets/snippets/ajaxSearch/js/clearDefault.js
                    [mbstring] => 1
                    [asLog] => 0:0:200
                    [idType] => parents
                    [listIDs] => 34,42,45
                    [docgrp] => 28,16,17,18,19,20,21,22,23,24,25,26,27
                )
                
                
                


                Nothing more embarrassed