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.
dev-master
2024-06-28 11:09 UTC
Requires
- illuminate/http: ^7.0|^8.0|^9.0
- laravel/framework: ^8.78|^9.0|^10.0|^11.0
This package is auto-updated.
Last update: 2025-01-28 12:20:07 UTC
README
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);