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(4mo ago)33191GPL-3.0-or-laterPHP

Since Aug 10Pushed 4mo 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 today

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

40

—

FairBetter than 86% of packages

Maintenance74

Regular maintenance activity

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

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

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

[algolia/algoliasearch-magento-2

Algolia Search &amp; Discovery extension for Magento 2

1881.9M19](/packages/algolia-algoliasearch-magento-2)[mollie/magento2

Mollie Payment Module for Magento 2

1131.9M16](/packages/mollie-magento2)[yireo/magento2-whoops

Magento 2 module adding Whoops error handling

104756.5k](/packages/yireo-magento2-whoops)[smile/module-elasticsuite-cms-search

Smile Elasticsuite - Cms Pages Search Module for Smile Elasticsuite.

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

Doofinder module for Magento 2

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

Smile ElasticSuite - Rating search module.

1498.6k3](/packages/smile-module-elasticsuite-rating)

PHPackages © 2026

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