I am using the Weighted Search plugin on Craft 3. Everything works except the excerpt does not load. My code is below.

{% set query = craft.request.getParam('searchQuery') %}
{% set results = craft.weightedSearch.substringSearch(query) %}

{% if results %}
    {% for searchResult in results %}
        <a href="{{ searchResult.entry.url }}">{{ searchResult.entry.title }}</a>
        <a href="{{ searchResult.entry.url }}">{{ searchResult.entry.url }}</a>
        <p>{{ searchResult.excerpt|raw }}</p>
    {% endfor %}
{% else %}
    <p>No matching results found!</p>
{% endif %}
  • I can see several reason why excerpt would be empty looking at the code, but it's hard to know for sure without having your database and knowing your environment. github.com/venveo/craft3-weightedsearch/blob/develop/src/… – Brad Bell Oct 20 at 3:03
  • The only entity that doesn't load is the excerpt. Everything else is fine. A dump of the results array shows ["excerpt"]=> string(0) "". I rebuilt the search indexes and no luck. I'm at a loss as to where to go next. – triplethreat23 Oct 29 at 21:11

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.