Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 793 Bytes

File metadata and controls

34 lines (25 loc) · 793 Bytes

marko/search

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;

$driver = new DatabaseSearchDriver(
    connection: $connection,
    tableName: 'posts',
    searchable: new Post(),
);

$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