Download the PHP package renatomaldonado/manticore-laravel-search without Composer

On this page you can find all versions of the php package renatomaldonado/manticore-laravel-search. 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 manticore-laravel-search

Laravel Manticore Search

A driver for integrating Manticore Search with Laravel, featuring a fluent query builder, Eloquent model hydration, robust pagination, and support for multiple named connections.

Related packages

If you need full Eloquent support (migrations, create, update, delete, relations, scopes, casts) natively on Manticore, see laravel-manticore-eloquent — a Laravel database driver over the Manticore MySQL protocol.

This package (manticore-laravel-search) focuses on the HTTP/JSON search API, fluent query builder, consolidation, and facets.

What this library does

Requirements

Dependency Version
PHP ^8.1
Laravel ^10.0 \| ^11.0 \| ^12.0
manticoresoftware/manticoresearch-php ^4.0

Installation

Configuration

Publish the config file:

Named connections (recommended)

Legacy flat config (backward compatibility)

If connections is empty or missing, the resolver falls back to the flat top-level keys (manticore.host, manticore.port, etc.) that predate multi-connection support.

Model setup

Add the HasManticoreSearch trait and implement searchableAs().

searchableAs() may return a string or an array of index names for multi-index queries.

Quick example

Builder API

Filtering

Method Description
match(string $keywords, ?string $field, string $boolean) Full-text search. $field defaults to *.
where(string $field, mixed $op, mixed $value) Equality or comparison. Supports =, !=, <>, >, >=, <, <=.
orWhere(string $field, mixed $op, mixed $value) OR variant of where.
whereNot(string $field, mixed $op, mixed $value) Negated filter.
whereIn(string $field, array $values) IN filter.
whereNotIn(string $field, array $values) NOT IN filter.
whereBetween(string $field, array $range) Range filter [min, max].
whereNull(string $field) IS NULL — SQL mode only.
whereNotNull(string $field) IS NOT NULL — SQL mode only.
whereRaw(string $sql, string $boolean) Inject a raw SQL fragment — SQL mode only.
whereGeoDistance(string $field, float $lat, float $lon, float $meters) Geo-distance filter.

Ordering, limiting, selecting

Method Description
orderBy(string\|array $column, ?string $direction) Accepts a column + direction, or an [col => dir] array.
limit(int $limit)
offset(int $offset)
forPage(int $page, int $perPage) Sets limit + offset for the given page number.
select(array\|string $fields) Triggers SQL mode.
groupBy(array\|string $fields) Triggers SQL mode.
having(array\|string $conditions) Triggers SQL mode.

Options and metadata

Method Description
option(string $key, mixed $value) Set a Manticore query option (max_matches, etc.).
maxMatches(int $value) Shorthand for option('max_matches', $value).
aggregate(string $name, array $aggregation) Add a facet aggregation.
expression(string $name, mixed $exp) Add a script/expression field.
withHighlight() Enable highlight in Search API responses.

Eager loading

Connection and index overrides

Method Description
usingConnection(string $name) Use a named connection from config. Flushes the local client cache.
useIndex(string\|array $indexes) Override searchableAs(). Supports multi-index.
rawQuery(string $sql, bool $rawMode) Execute manual SQL, bypassing the builder.

Utility chainables

Method Description
when(mixed $condition, callable $cb, ?callable $default) Apply a callback only when $condition is truthy.
tap(callable $callback) Inspect/modify the builder mid-chain without breaking it.
dump() Dump the compiled SQL and options, then continue the chain.
dd() Dump the compiled SQL and options, then exit.

Execution

Method Returns
get() Illuminate\Database\Eloquent\Collection
first() Model or null
last() Model or null
count() int
pluck(string $field) Collection
toArray() array
toJson(int $options) string
toSql() string — compiled SQL, no network call
chunk(int $size, callable $callback) Iterates results in pages; returns false if callback returns false.
paginate(int $perPage, string $pageName, ?int $page) LengthAwarePaginator
getFacets() array (not available in rawQuery mode)

Consolidation (group-merge)

Consolidation fetches multiple documents and merges all rows that share the same $groupField value into a single model, storing the originals under a $historyAttribute.

getConsolidatedBy() is an alias for consolidateAllBy() kept for backward compatibility.

Pagination and filter preservation

paginate() and paginateConsolidatedBy() automatically carry the current request's filters into the paginator links — including GET params, POST/JSON bodies, and custom page key names.

When the query string exceeds pagination.max_query_length bytes, the filters are stored in cache and replaced with a short token (_mctx) in the link. The full payload is restored on the next request.

To recover the full input payload manually:

To flush the cached total count for a query:

Relevant config keys under pagination:

Key Default Description
context_key _mctx URL token name for cached filter context.
max_query_length 1500 Byte threshold above which context caching activates.
context_ttl 900 Seconds to keep the filter context in cache.
cache_prefix manticore:pagination: Cache key prefix.
total_cache_ttl 300 Seconds to cache the total count between pages.

Optional facade

Architecture overview

Practical examples

SQL mode

Raw SQL

Facets

Chunked processing

Multi-connection

Debug

Tests

The CI workflow (.github/workflows/tests.yml) runs Unit and Feature tests across PHP 8.1–8.3 and Laravel 10–12, and Integration tests against a live Manticore Search container on PHP 8.2–8.3.


All versions of manticore-laravel-search with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/framework Version ^10.0|^11.0|^12.0
manticoresoftware/manticoresearch-php Version ^4.0
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 renatomaldonado/manticore-laravel-search contains the following files

Loading the files please wait ...