We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23515
    • 40 Posts
    Having some issues with &parents. The following snippet doesn’t restrict the search to the first level of document 47, still does a global, its probably something obvious but can’t see it myself:

    [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`91` &AS_showResults=`0` &parents=`47` &depth=`1`!]

    The snippet on doc 91 is the same, but with &AS_showForm=`0`. Thinking about it, out of interest, which snippet call determines how the search is done, the form one or the landing page one? I usually just copy and paste one to the other, and tweak the &showresults parameter.

    Any ideas?

    Cheers
      • 5811
      • 1,717 Posts
      The following snippet doesn’t restrict the search to the first level of document 47
      By writing &parents=`47` you do the search in the children of the document #47. By default the parameter &depth is set to 10. So you possibly search among ten levels of the document tree under the #47. The document #47 is excluded of the search.

      &parents : A comma separated list of parent-documents whose descendants you want searched to &depth depth when searching.

      which snippet call determines how the search is done, the form one or the landing page one? I usually just copy and paste one to the other, and tweak the &showresults parameter.
      In the non ajax mode (&ajaxSearch=`0`, the call on the landing page determines how is the search is done. With the ajax mode, the both call are important. The first one give you the list of documents with the relevant extracts and the second one (more-results page) as the landing page, all the results with pagination.
        • 23515
        • 40 Posts
        Thanks for the info, useful to know.

        This is the snippet from the landing page:

        [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`91` &highlightResult=`0` &AS_showForm=`0` &parents=`47` &depth=`1`!]

        It’s definitely not restricting searches. Basically doc 47 is an events holder (each event has a separate doc, within 47), but when I search I can see the home page in results. Is there any reason it’ll be ignoring the parents param?

        Cheers
          • 23515
          • 40 Posts
          I’m bumping this as I’m back on this now, does anyone know of ANY reason why &parents=`ID` would be ignored?