Search by

marko / search

markshust

Search interfaces and value objects for Marko Framework

Package info

github.com/marko-php/marko-search

Type:marko-module

pkg:composer/marko/search

Statistics

Installs: 17

Dependents: 0

Suggesters: 0

Stars: 0

0.11.0 2026-10-06 13:37 UTC

README

Generic search abstraction--add full-text search to any entity with a database driver included and support for Elasticsearch, Meilisearch, and Typesense drivers.

Installation

composer require marko/search

Quick Example

use Marko\Search\Driver\DatabaseSearchDriver;
use Marko\Search\Value\SearchCriteria;

// Post implements SearchableInterface (and SortableInterface to allow sorting by created_at)
$driver = new DatabaseSearchDriver(
    connection: $connection,
    tableName: 'posts',
    searchable: new Post(),
    config: $searchConfig,
);

$result = $driver->search(
    query: 'php tutorial',
    criteria: SearchCriteria::create('php tutorial')
        ->withSort('created_at', 'desc')
        ->withPage(1)
        ->withPerPage(10),
);

Documentation

Full usage, API reference, and examples: marko/search