MAGNOLIA CMS - cmsu:simpleSearch works in Author instance but returns no results in Public instance

StackOverflow https://stackoverflow.com/questions/7488265

  •  23-01-2021
  •  | 
  •  

سؤال

I am using the following code to display my search results

<c:if test="${!empty param.SearchName}">
    <h1>Results for "${fn:escapeXml(param.SearchName)}"</h1>
    <ol>
        <cmsu:simpleSearch query="${param.SearchName}" var="results" startLevel="1" />
        <c:if test="${empty results}">
            <p>No results could be found</p>
        </c:if>
        <c:forEach var="node" items="${results}">
            <li>
                <span class="pageTitle"><a href="${pageContext.request.contextPath}${node.handle}.html">${node.title}</a></span>

                <a href="${pageContext.request.contextPath}${node.handle}.html"><p class="snipet"><cmsu:searchResultSnippet query="${fn:escapeXml(param.SearchName)}" page="${node}" chars="120"/></p></a>
            </li>
        </c:forEach>
    </ol>
</c:if>

It works fine in the Author instance but for some reason the result set returned in public instance is always empty.

The condition always returns true.

Any idea where this issue is coming from?

Thanks in advance, A.

هل كانت مفيدة؟

المحلول

2 ideas were suggested by Danilo Ghirardelli that could be the source of the problem:

  1. Permission issue in the public instance. Read permission for the anonymous user and/or query searching in repositories that have no anonymous access.
  2. indexes are broken on public instance and you may have to regenerate them. Deactivate and reactivate the entire website may fix this issue.

After checking those possibilities:

  1. The permission of the anonymous user were correct.
  2. I deactivated and reactivated the entire website and it did work out!

    • A better solution than point 2 is this:

3.a In Author Instance's admin panel, export all the pages from the "The-Insider" root page

3.b In Public Instance's admin panel, delete all the pages

3.c In Public Instance's admin panel, activate changes on the "The-Insider" root page

3.d In Public Instance's admin panel, import the xml file you generated from step 3.a

A.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top