maple/msearch

A package for interacting with Meilisearch

This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.

Installs: 9

Dependents: 0

Suggesters: 0

Security: 0

Type:laravel-package

pkg:composer/maple/msearch

dev-master 2024-06-28 11:09 UTC

This package is auto-updated.

Last update: 2025-01-28 12:20:07 UTC


README

Latest Version on Packagist Total Downloads

This package makes it easy to get structured search from a meilisearch.

Installation

Installed using composer:

composer require maple/msearch

Publish

Once the package has been installed, you may need to publish config:

// Publish config
php artisan vendor:publish --provider="SearchEngine\ServiceProvider" --tag="config"

Usage

To get the documents from existing index

$searchResults = (new Documents())
   ->getDocuments($index_uid, $offset = 0, $limit = 20, $attributesToRetrieve = "*");

To get a single document from existing index

$searchResults = (new Documents())
   ->getDocument($index_uid, $document_id);

To add a new document fto the index

$searchResults = (new Documents())
   ->addDocuments($index_uid, $documents);

To update a document

$searchResults = (new Documents())
   ->updateDocuments($index_uid, $documents);

To delete all document

$searchResults = (new Documents())
   ->deleteDocuments($index_uid);

To delete a document

$searchResults = (new Documents())
   ->deleteDocument($index_uid, $document_id);

To delete documents by batch

$searchResults = (new Documents())
   ->deleteBatchDocument($index_uid, $document_ids);