PHPackages                             jundayw/laravel-bm25 - 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. jundayw/laravel-bm25

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

jundayw/laravel-bm25
====================

bm25 is an algorithm used to evaluate the correlation between search terms and documents. It is an algorithm based on a probabilistic retrieval model.

v1.0.0(4y ago)18MITPHPPHP &gt;=7.2.0

Since Jul 3Pushed 4y ago1 watchersCompare

[ Source](https://github.com/jundayw/laravel-bm25)[ Packagist](https://packagist.org/packages/jundayw/laravel-bm25)[ RSS](/packages/jundayw-laravel-bm25/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

安装方法
====

[](#安装方法)

命令行下, 执行 composer 命令安装:

```
composer require jundayw/laravel-bm25

```

示例
==

[](#示例)

```
$docs     = [
    '深圳保障房计划给出最新公租房、安居房消息！没房的赶紧来看！',
    '在深圳，有多少人每个月最大的一笔支出就是房租。所以大家都挺关心公租房消息的，毕竟公租房能让房租这笔支出少一些又或者是期待安居房能让自己有点买房的机会。',
    '深圳的保障房工作近几年进展就很不错。从最初的廉租房、公租房、经济适用住房，发展到今天的公租房、安居房和人才住房。',
    '保障群体从最初的户籍低收入家庭，扩展到现在的户籍中低收入家庭、人才家庭，以及为城市提供基本公共服务的公交司机、环卫工人和先进制造业职工等群体',
    '保障群体从最初的户籍低收入家庭，扩展到现在的户籍中低收入家庭、人才家庭，以及为城市提供基本公共服务的公交司机、环卫工人和先进制造业职工等群体',
    '好消息，新版租房合同来袭，在深圳租房的你有福了！',
];
$keywords = ['租房', '深圳'];
$bm25     = new BM25(1.2, 0.75);
foreach ($docs as $doc) {
    dump(current($keywords) . '-bm25计算：' . $bm25->keyword(current($keywords), $doc, $docs));
}
dump('--------------keyword--------------');
foreach ($docs as $doc) {
    dump(last($keywords) . '-bm25计算：' . $bm25->keyword(last($keywords), $doc, $docs));
}
dump('--------------keyword--------------');
foreach ($docs as $doc) {
    dump(join(',', $keywords) . '-bm25计算：' . $bm25->keywords($keywords, $doc, $docs));
}
dump('--------------keywords--------------');
dd([
    $bm25->map($keywords, $docs)->getRanks(),
    $bm25->map($keywords, $docs)->argsort(),
]);
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1463d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16873970?v=4)[Xander Moore](/maintainers/jundayw)[@jundayw](https://github.com/jundayw)

---

Top Contributors

[![jundayw](https://avatars.githubusercontent.com/u/16873970?v=4)](https://github.com/jundayw "jundayw (1 commits)")

---

Tags

laravelbm25

### Embed Badge

![Health badge](/badges/jundayw-laravel-bm25/health.svg)

```
[![Health](https://phpackages.com/badges/jundayw-laravel-bm25/health.svg)](https://phpackages.com/packages/jundayw-laravel-bm25)
```

###  Alternatives

[mobileka/scope-applicator

Scope Applicator is a PHP trait that makes data filtering and sorting easy.

251.2k2](/packages/mobileka-scope-applicator)[remoblaser/search

A simple to implement Search for your Application

101.5k](/packages/remoblaser-search)

PHPackages © 2026

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