PHPackages                             mustasj/expanded-search - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. mustasj/expanded-search

ActiveCraft-plugin[Search &amp; Filtering](/categories/search)

mustasj/expanded-search
=======================

An expansion of Crafts search

1.3.7(5y ago)716.7k↑30%7[3 issues](https://github.com/mustasj-as/expanded-search/issues)[1 PRs](https://github.com/mustasj-as/expanded-search/pulls)MITPHPCI failing

Since Feb 28Pushed 4y ago2 watchersCompare

[ Source](https://github.com/mustasj-as/expanded-search)[ Packagist](https://packagist.org/packages/mustasj/expanded-search)[ RSS](/packages/mustasj-expanded-search/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (6)Dependencies (1)Versions (9)Used By (0)

Expanded Search plugin for Craft CMS 3.x
========================================

[](#expanded-search-plugin-for-craft-cms-3x)

Ported  from Craft 2 to Craft 3. Is is an expansion of Crafts search, which gives you a context for search hits.

[![Screenshot](resources/img/plugin-logo.png)](resources/img/plugin-logo.png)

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 3.1.0 or later.

Installation
------------

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
    cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
    composer require mustasj/expanded-search

    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Expanded Search.

Using Expanded Search
---------------------

[](#using-expanded-search)

The first parameter is the search term. Which will be salted automatically: `*{term}*`The second is settings.

SettingTypePurposeDefaultlengthintCuts off the search value at given length300sectionarray/stringsection names to search innull (all sections)sectionIdarray/intid of sections to search innull (all sections)limitinthow many results to return (pagination)0 (all)offsetinthow many results to skip (pagination)0subLeftboolto use fuzzy search lefttruesubRightboolto use fuzzy search righttrueIn your search results template

```
{% set expandedResults = craft.expandedSearch.search(query) %}
{% set expandedResults = craft.expandedSearch.search(query, { sections: ['news'], length: 150 }) %}
{% for result in expandedResults %}
    {{result.entry.title}}
    {{result.matchedValue}}
    {{result.entry.url}}
{% else %}
    Sorry, no results for {{query}}.
{% endfor %}

```

Expanded Search from Element API
--------------------------------

[](#expanded-search-from-element-api)

To use the plugin from ElementAPI. Do a normal search and then for each result, you can fetch the `ExpandedSearchModel` from the service

```
'transformer' => function(Entry $entry) {
    $searchResults = ExpandedSearch::$plugin->expandedSearchService->expandSearchResults($entry, $query, $length);
    return [
        'id' => $entry->title,
        'title' => $entry->title,
        'matchedValue' => $searchResult->matchedValue,
        'matchedField' => $searchResult->matchedField
    ];
},

```

Expanded Search Roadmap
-----------------------

[](#expanded-search-roadmap)

Some things to do, and ideas for potential features:

- Release it
- Add proper pagination within the plugin
- Add handling for more fields

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance11

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~87 days

Recently: every ~126 days

Total

7

Last Release

2150d ago

Major Versions

0.0.2 → 1.0.02019-03-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/88489731d06ed746fc889be548b1cc28f65e8f92a515647c6c279c47915620d3?d=identicon)[mustasj](/maintainers/mustasj)

---

Top Contributors

[![peirix](https://avatars.githubusercontent.com/u/347175?v=4)](https://github.com/peirix "peirix (35 commits)")

---

Tags

cmsCraftcraftcmscraft-pluginexpanded search

### Embed Badge

![Health badge](/badges/mustasj-expanded-search/health.svg)

```
[![Health](https://phpackages.com/badges/mustasj-expanded-search/health.svg)](https://phpackages.com/packages/mustasj-expanded-search)
```

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

100387.6k57](/packages/verbb-formie)[studioespresso/craft-scout

Craft Scout provides a simple solution for adding full-text search to your entries. Scout will automatically keep your search indexes in sync with your entries.

80141.4k](/packages/studioespresso-craft-scout)[verbb/vizy

A flexible visual editor field for Craft.

4249.7k](/packages/verbb-vizy)[verbb/hyper

A user-friendly links field for Craft.

24142.6k12](/packages/verbb-hyper)[verbb/social-poster

Automatically post entries to social media.

918.5k](/packages/verbb-social-poster)[verbb/icon-picker

A slick field to pick icons from. Supports SVGs, Sprites, Webfonts, Font Awesome and more.

16168.8k6](/packages/verbb-icon-picker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
