0

With the search example snippet provided in the documentation

https://documentation.magnolia-cms.com/display/DOCS/Search#Search-Displayingpagesinthewebsiteworkspace

[#list searchResults as item]
    <a href="${cmsfn.link(item)}" class="list-group-item">
        <h4 class="list-group-item-heading">${item.title!}</h4>
        <p class="list-group-item-text">${item.excerpt!}</p>
    </a>
[/#list]

the variable ${item.excerpt!} returns the excerpts for all languages, not only the current locale. So if I have a page in German (de) and French (fr), this ${items.excerpt!} contains and shows an indexed title element for example twice. Does Solr not extract and store the text separately per language?

${item.title} is shown in the correct language.

How is it possible to just get the excerpt for the current locale?


DE search (showing also French text):

enter image description here


FR search (showing also German text):

enter image description here

1 Answer 1

1

As the excerpt property isn't actually a property, but a result of the Jackrabbit rep:excerpt() function (see the SearchTemplatingFunctions code), the short answer is no, it's not possible.

Anyway, you can always implement your own SearchTemplatingFunctions (and/or ExcerptProvider for Jackrabbit).

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.