composedcreative/expandedsearch

Craft CMS search results with expanded meta data including the matched field, matched value and related values for certain field types

0.1.3 2016-06-02 18:09 UTC

This package is not auto-updated.

Last update: 2024-04-27 16:42:22 UTC


README

Installation

composer require composed/expandedsearch

Example

In your search results template

{% set expandedResults = craft.expandedSearch.search(query) %}
{% for result in expandedResults %}
    <strong data-field="{{result.matchedField}}">{{result.entry.title}}</strong><br>
    <p>{{result.matchedValue}}</p>
    <a href="{{result.entry.url}}">{{result.entry.url}}</a>
{% else %}
    <p>Sorry, no results for {{query}}.</p>
{% endfor %}

Roadmap

  • Improve documentation
  • Add handling for more non-scalar field types