Download the PHP package ols/php-fts without Composer

On this page you can find all versions of the php package ols/php-fts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-fts

php-fts

Packagist Version PHP Version License Downloads

A self-contained full-text search engine written in pure PHP.
No extensions. No external services. No dependencies. Just files.


Who is this for?

php-fts is designed for projects where deploying a dedicated search service is not an option — shared hosting, small VPS, or simply situations where you want to keep your stack minimal and portable.

If you have access to Elasticsearch, Meilisearch or Typesense and the infrastructure to run them, use those. They are more powerful and built for high-traffic, large-scale workloads.

If you don't — or if you'd rather not — php-fts gives you solid full-text search with ranked results, filters, and tolerant matching, with nothing to install and nothing to configure beyond a directory path.

It is a good fit if:

It is not a good fit if:


Language support

php-fts is designed for Western Latin languages (French, English, Spanish, German, Portuguese, Italian, Dutch, and similar).

The tokenizer normalizes input by transliterating accented characters and common diacritics to their ASCII equivalents (ée, üu, ñn, etc.), then indexes the result as trigrams.

This approach has limitations you should be aware of:

If your content is primarily in Western European languages and ASCII-compatible, php-fts will work well. For multilingual or non-Latin content, a dedicated search engine with proper Unicode support is a better fit.


Features


Requirements


Installation

Via Composer

Manual install — if you are not using Composer, copy the src/ directory into your project and include the autoloader:


Quick start


API Reference

Open / Close

Insert

Supported field types: string, int, float, bool, array of strings.

Search

Each result:

The score field is available on every result and can be used to build facet counts, custom sorting, or relevance thresholds.

Highlighting

Pass highlight: true to get a highlights field on each result, containing one snippet per string field. No overhead when disabled (default).

When excerpt is false, the full field value is returned with all matches wrapped in the specified tags.

Filters

Both and and or are optional, but at least one must be present.
When both are used: all AND conditions must pass and at least one OR condition must pass.
A document missing a filtered field is excluded from results.

Operator Supported types
= != int, float, bool, string
> >= < <= int, float
in not in int, float, string
contains not contains array (document field)

Update / Delete

Maintenance


Index files

Files are fully portable — copy them between servers without rebuilding.


Scoring

Relevance is computed using BM25 + IDF:


Benchmark

Benchmarks were run on two environments:

Insertion

Volume insert() Windows insert() Linux insertBulk() Windows insertBulk() Linux
1 000 5.3 s 7.3 s 3.0 s 3.0 s
5 000 33.5 s 14.8 s
10 000 53.0 s 63.4 s 30.5 s 29.4 s
50 000 282.2 s 157.8 s

Insertion is an offline operation — indexing is typically done via a scheduled job, not at request time.
Always prefer insertBulk() in production: it acquires a single lock for the entire batch and is consistently ~2x faster.

Index size

Volume Index size
1 000 2.8 MB
10 000 21.7 MB
50 000 106.0 MB

Search — Linux shared hosting, 10 000 documents

Metric Value
Median 3.2 ms
Average 4.9 ms
P95 12.5 ms
P99 22.9 ms
Min / Max 1.3 ms / 37.1 ms

200 queries, 10 distinct queries in rotation (including typos and out-of-corpus queries).
Measured with hrtime() on a live shared hosting environment under normal load.


Example application

The gif below shows one possible use of php-fts — a product search interface with filters and ranked results, built on top of a fake shoe catalogue.

It is just an illustration. php-fts is an engine, not an interface. You can use it to power a product search, a documentation search, an admin filter, a CLI tool, or anything else that needs full-text matching over a set of documents.

To run it locally:

No database. No external service. The filters, scores, and result counts are all computed by the engine.


License

MIT — see LICENSE.


All versions of php-fts with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ols/php-fts contains the following files

Loading the files please wait ...