PHPackages                             k-samuel/faceted-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. k-samuel/faceted-search

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

k-samuel/faceted-search
=======================

PHP Faceted search

3.2.4(2mo ago)22668.1k↓28.5%171MITPHPPHP &gt;=7.4.0CI passing

Since Feb 20Pushed 2mo ago14 watchersCompare

[ Source](https://github.com/k-samuel/faceted-search)[ Packagist](https://packagist.org/packages/k-samuel/faceted-search)[ Docs](https://github.com/k-samuel/faceted-search)[ RSS](/packages/k-samuel-faceted-search/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (42)Used By (1)

[![PHP Version](https://camo.githubusercontent.com/248632894d9d27a25ffd8e154ef857059e7aedef81ab34c3a5b19fd6a912d3a0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e342532422d626c75652e737667)](https://packagist.org/packages/k-samuel/faceted-search)[![Total Downloads](https://camo.githubusercontent.com/e9b1f0ba1482133dc54453e041fa09c16849338281826562592f14c5943c3644/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b2d73616d75656c2f666163657465642d7365617263682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/k-samuel/faceted-search)[![Build and Test](https://github.com/k-samuel/faceted-search/actions/workflows/php.yml/badge.svg?branch=master)](https://github.com/k-samuel/faceted-search/actions/workflows/php.yml)[![Codacy Badge](https://camo.githubusercontent.com/57daf5c6043f1684816a9426302143ef53979d97ba48770808b10b8b0a9343e7/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6239643137343936396331623435376661386136633362373533323636363938)](https://app.codacy.com/gh/k-samuel/faceted-search/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![Codacy Badge](https://camo.githubusercontent.com/db609ee5d82a1de53c0b853c4cee8bc2b70897fca152e0af1e0f61ac51eb9a19/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f6239643137343936396331623435376661386136633362373533323636363938)](https://app.codacy.com/gh/k-samuel/faceted-search/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)

PHP Faceted search library 3.x
==============================

[](#php-faceted-search-library-3x)

Simplified and fast faceted search without using any additional servers such as ElasticSearch, etc.

It can easily process up to 500,000 items with 10 properties. Create individual indices for product groups or categories and you won't need to scale or use more complex tools for a long time. The software is more effective when operates together with Roadrunner, Swoole, etc.

In addition to faceted filters, it supports exclusive filters. The software is optimized for uncompromising performance.

[Changelog](./changelog.md) | [2.x version](https://github.com/k-samuel/faceted-search/tree/2.x)

Install
-------

[](#install)

`composer require k-samuel/faceted-search`

Aggregates
----------

[](#aggregates)

The main advantage of the library is the fast and simplified building of aggregates.

Aggregates in Simple Terms

[![](https://github.com/k-samuel/faceted-search/raw/master/docs/filters.png)](https://github.com/k-samuel/faceted-search/blob/master/docs/filters.png)

Imagine that a user has chosen several filters in the interface. We need to update the interface so that only filters compliant with the user’s choice (overlapping product properties) are represented in a list of available filters. We also have to display a number of available products hidden behind each filter. Every time a user selects a new parameter, аt the code level, determine how many options are available based on the user's selection and display a new list of filters in the interface

This is simple enough, even if products have different structure of properties.

```
