PHPackages                             zero1/search-query-optimization - 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. zero1/search-query-optimization

ActiveLibrary[Search &amp; Filtering](/categories/search)

zero1/search-query-optimization
===============================

1.0.4(6mo ago)33191GPL-3.0-or-laterPHP

Since Aug 10Pushed 6mo ago2 watchersCompare

[ Source](https://github.com/zero1limited/magento2-search-query-optimization)[ Packagist](https://packagist.org/packages/zero1/search-query-optimization)[ RSS](/packages/zero1-search-query-optimization/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (4)Dependencies (3)Versions (6)Used By (0)

Search Query Optimization
=========================

[](#search-query-optimization)

Description
-----------

[](#description)

This module is designed to optimize a few things around the "suggested search terms" returned by Magento when typing in the search bar at the top of the page. The current optimizations are:

- increase default cache size of these results from 100 =&gt; 1000
- implements a decay functionality to the `search_query` table (see [Decay Function](#decay-function))

### Decay Function

[](#decay-function)

When a user searches for a term, Magento adds this term to the `search_query` table. When another search for the same term happens Magento increments the `popularity` of the term. This allows Magento to return "the most popular" results for the term being searched for. However Magento does not implement any way of clearing down these search terms automatically, leaving you with a table that only ever grows. Which means the response time will increase (larger table ~= longer response times).

This module runs a cronjob every minute that looks for any records that haven't been used in the last "Decay Days" (see [settings](#settings)), don't have a redirect and haven't been processed. It will then decrement the popularity of the term. If the term is at popularity 0, it will be removed from the table.

Settings
--------

[](#settings)

NameLocationDefault ValueDescriptionDecay DaysStores =&gt; Configuration =&gt; CatalogCatalog =&gt; Catalog Search30Commands
--------

[](#commands)

### Decay

[](#decay)

The decay function can be ran manually

```
php bin/magento zero1:search-query-optimization:decay
```

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance67

Regular maintenance activity

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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 ~319 days

Total

5

Last Release

194d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b08c35b603becab270a53db6ec969f48be0c353a20ee2985bb1a8ec5a9b64e9?d=identicon)[zero1](/maintainers/zero1)

---

Top Contributors

[![adamzero1](https://avatars.githubusercontent.com/u/6369163?v=4)](https://github.com/adamzero1 "adamzero1 (3 commits)")[![bradley-zero1](https://avatars.githubusercontent.com/u/183477695?v=4)](https://github.com/bradley-zero1 "bradley-zero1 (2 commits)")

---

Tags

magentomagento 2mysql searchAjax search resultssearch\_query table

### Embed Badge

![Health badge](/badges/zero1-search-query-optimization/health.svg)

```
[![Health](https://phpackages.com/badges/zero1-search-query-optimization/health.svg)](https://phpackages.com/packages/zero1-search-query-optimization)
```

###  Alternatives

[mollie/magento2

Mollie Payment Module for Magento 2

1142.0M17](/packages/mollie-magento2)[walkwizus/magento2-module-meilisearch

Meilisearch integration for Magento 2

551.0k3](/packages/walkwizus-magento2-module-meilisearch)[smile/module-elasticsuite-cms-search

Smile Elasticsuite - Cms Pages Search Module for Smile Elasticsuite.

25983.2k1](/packages/smile-module-elasticsuite-cms-search)[doofinder/doofinder-magento2

Doofinder module for Magento 2

12256.9k1](/packages/doofinder-doofinder-magento2)[smile/module-elasticsuite-rating

Smile ElasticSuite - Rating search module.

14100.5k3](/packages/smile-module-elasticsuite-rating)[lion/bundle

Lion-framework configuration and initialization package

132.4k5](/packages/lion-bundle)

PHPackages © 2026

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