Download the PHP package monkeyscloud/monkeyslegion-search without Composer

On this page you can find all versions of the php package monkeyscloud/monkeyslegion-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 monkeyslegion-search

monkeyslegion-search

Multi-engine full-text, hybrid, and semantic search adapter for MonkeysLegion v2 with attribute-driven index syncing, auto-sync observers, queued indexing, and enterprise-grade query features.

PHP [Tests]()

Features

Feature Description
6 Engine Adapters Meilisearch, Typesense, OpenSearch, Elasticsearch, Apache Solr, Null (testing)
SearchableTrait Scout-style toSearchableArray(), shouldBeSearchable(), search(), makeSearchable()
Auto-Sync Observers Automatic index sync on entity create/update/delete via #[ObservedBy] or #[Subscribe]
Queued Indexing Async index operations via monkeyslegion-queue integration
Fluent Query Builder Chainable API for search, filter, sort, facet, highlight, geo, aggregate
Hybrid Search BM25 + vector scoring with configurable weight blending
Geo-Distance Search near(), withinRadius(), sortByDistance() with per-hit distance
Advanced Aggregations sum, avg, min, max, cardinality, histogram, date_histogram, terms
Autocomplete / Suggest Engine-native prefix suggestions across all adapters
Search Scopes Reusable, composable query modifiers
Middleware Pipeline Intercept queries for logging, analytics, caching, rate limiting
Multi-Index Search Cross-index queries with score re-ranking
Raw Engine Queries Engine-native DSL passthrough when the Builder isn't enough
Cursor Iteration Memory-efficient lazy iteration over large result sets
Batch Reindexing Chunked import with progress callbacks + zero-downtime alias swaps
Zero Dependencies Internal cURL HTTP client — no PSR-18 or Guzzle required
PHP 8.4 Property Hooks Computed properties on DTOs ($offset, $lastPage, $isHybrid, $isGeo)

Installation

Requirements

Requirement Version
PHP ^8.4
Extensions ext-curl, ext-json
Optional monkeyslegion-queue (async indexing), monkeyslegion-entity (auto-sync)

Quick Start

1. Mark Your Entity as Searchable

2. Configure Search Engines (MLC)

3. Search with the Fluent Builder

SearchableTrait

The SearchableTrait provides a Scout-style API for any entity:

Key Methods

Method Description
toSearchableArray() Override to control indexed data structure
shouldBeSearchable() Override for conditional indexing (e.g. skip drafts)
getSearchKey() Document ID (defaults to $id)
getSearchIndex() Index name (from #[Searchable] or auto-generated)
static search(string $term) Create a fluent Builder for the entity
searchable() Index this entity instance
unsearchable() Remove this entity from the index
static makeSearchable(iterable) Bulk-index entities
static makeUnsearchable(iterable) Bulk-remove entities

Auto-Sync (Observers)

Per-Entity Observer

Add #[ObservedBy(SearchObserver::class)] to your entity for automatic sync on create/update/delete:

Global Subscriber (Zero-Config)

The SearchSubscriber listens to ALL entities via #[Subscribe]. Just add #[Searchable] and SearchableTrait — no #[ObservedBy] needed:

Lifecycle Events

Event Action
created / saved Index document (if shouldBeSearchable() is true)
updated Re-index or remove (handles status transitions)
deleted Remove from index
restored Re-index document

Queued Indexing

Offload index operations to background workers via monkeyslegion-queue:

Geo-Distance Search

Advanced Aggregations

Go beyond simple facets with full aggregation support:

Supported Aggregation Types

Type Output Description
sum Scalar Sum of field values
avg Scalar Average
min Scalar Minimum value
max Scalar Maximum value
cardinality Scalar Unique value count
terms Buckets Top values by count
histogram Buckets Numeric ranges
date_histogram Buckets Date-based ranges

Autocomplete / Suggestions

Search Scopes

Encapsulate reusable query logic into composable scopes:

Middleware Pipeline

Intercept and instrument search queries with a middleware stack:

Custom Middleware

Multi-Index Search

Search across multiple indexes with merged, score-ranked results:

Raw Engine Queries

When the Builder abstraction isn't enough, pass engine-native DSL directly:

Cursor Iteration

Memory-efficient streaming for processing large result sets:

Batch Reindexing

Chunked import with progress callbacks and zero-downtime alias swaps:

Hybrid Search (BM25 + Vector)

Combine traditional full-text scoring with vector similarity for semantic search:

Sync Index Schema

Attributes Reference

#[Searchable] — Class Level

Parameter Type Default Description
index ?string Auto-generated Custom index name
engine string 'default' Engine connection name
autoSync bool true Auto-index on persist/delete
queue bool false Queue indexing via monkeyslegion-queue
idField string 'id' Property used as document ID

#[SearchField] — Property Level

Parameter Type Default Description
searchable bool true Include in full-text search
filterable bool false Allow filter expressions
sortable bool false Allow sorting
facetable bool false Generate facet counts
weight int 1 Relevance weight multiplier
analyzer ?string null Custom analyzer (engine-specific)
as ?string null Custom field name in index

#[SearchIndex] — Class Level

Parameter Type Default Description
stopWords list<string> [] Words to ignore
synonyms array<string, list<string>> [] Synonym groups
rankingRules list<string> [] Engine-specific ranking
tokenSeparators list<string> [] Custom token separators
maxTotalHits ?int null Max retrievable hits
extra array<string, mixed> [] Raw engine settings

Engine Comparison

Feature Meilisearch Typesense OpenSearch Elasticsearch Solr
Full-text search
Filtering
Faceting
Sorting
Highlighting
Vector / kNN
Hybrid search
Geo search
Autocomplete
Raw queries
Index aliases
Default port 7700 8108 9200 9200 8983

✓ = Supported ○ = Limited/Experimental

Architecture

Testing

License

MIT — see LICENSE.


All versions of monkeyslegion-search with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
ext-curl Version *
ext-json Version *
monkeyscloud/monkeyslegion-core Version ^2.0
monkeyscloud/monkeyslegion-entity Version ^2.0
monkeyscloud/monkeyslegion-di Version ^2.0
monkeyscloud/monkeyslegion-events Version ^2.0
monkeyscloud/monkeyslegion-http-client Version ^1.0
psr/log Version ^3.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 monkeyscloud/monkeyslegion-search contains the following files

Loading the files please wait ...