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. mustasj/expanded-search

ActiveCraft-plugin

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

An expansion of Crafts search

1.3.7(5y ago)716.7k↓21.1%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 1mo 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 77% of packages

Maintenance11

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

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

2105d 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

[nystudio107/craft-seomatic

SEOmatic facilitates modern SEO best practices &amp; implementation for Craft CMS 5. It is a turnkey SEO system that is comprehensive, powerful, and flexible.

1741.4M46](/packages/nystudio107-craft-seomatic)[verbb/image-resizer

Resize assets when they are uploaded.

127269.1k7](/packages/verbb-image-resizer)[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[verbb/tablemaker

Create customizable and user-defined table fields.

40168.8k1](/packages/verbb-tablemaker)[wrav/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

36205.0k3](/packages/wrav-oembed)[verbb/hyper

A user-friendly links field for Craft.

24130.9k9](/packages/verbb-hyper)

PHPackages © 2026

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