Main Content

Magnolia Community Forums: Get help with Magnolia: Can startPath be "/" in SearchTemplatingFunctions?


  • grayzeng
    grayzeng
    Full name: Gray Zeng
    Posts: 10
    Last post: Nov 2, 2016 8:49:09 PM
    Registered on: Oct 19, 2016
    Can startPath be "/" in SearchTemplatingFunctions?
    #1 by grayzeng on Nov 2, 2016 8:44:32 PM

    Hi there,

    In my project I used SearchTemplatingFunctions to do the page/content search. The methods I used for search are:

    searchContent(String workspace, String queryString, String startPath, String returnItemType)
    searchContent(String workspace, String queryString, String startPath, String returnItemType, long limit, long offset)
    searchPages(String queryString, String startPath)
    searchPages(String queryString, String startPath, long limit, long offset)

    and I just notice an interesting issue: when I use "/" as startPath in those methods, I supposed I would get all items which match the qeuryString, but actually it always return 0 result. If I change the startPath as "/somepath" then the search result looks fine.

    Did I misunderstand the "startPath"?

    Thanks,
    Gray

  • grayzeng
    grayzeng
    Full name: Gray Zeng
    Posts: 10
    Last post: Nov 2, 2016 8:49:09 PM
    Registered on: Oct 19, 2016
    Re: Can startPath be "/" in SearchTemplatingFunctions?
    #2 by grayzeng on Nov 2, 2016 8:49:09 PM

    BTW, I have set the permission to allow access the workspace with "selected and sub nod" for path "/".

  • rgange
    rgange
    Full name: Richard Gange
    Posts: 49
    Last post: Oct 16, 2017 3:21:08 PM
    Re: Can startPath be "/" in SearchTemplatingFunctions?
    #3 by rgange on Nov 11, 2016 9:53:11 AM

    Hi Gray-

    I have heard of this issue. I would say it's a bug. If you look at this page https://documentation.magnolia-cms.com/display/DOCS/searchfn and the comment at the very bottom there is a workaround mentioned there. In the mean time I created a ticket here MTE-96.

    Cheers
    Rich

You don't have the permission to post on this thread

Sign in

To login on this forum, you can use your Magnolia Forge, Support or Partner account, or, below, your Google, Yahoo! or OpenID account. If you have trouble logging in, or any other sort of issue, please let us know in the Meta forum, on the user-list, or simply by email at forum-admin at magnolia-cms dot com.

* Required

... or sign in with:

  • icon http://{your-openid-url}
  • icon
  • icon https://me.yahoo.com/