meilisearch 0.1.1 meilisearch: ^0.1.1 copied to clipboard
MeiliSearch Dart is the MeiliSearch API client for Dart developers. Which you can also use for your Flutter apps as well. MeiliSearch is a powerful, fast, open-source, easy to use and deploy search engine.
import 'package:meilisearch/meilisearch.dart';
void main() async {
var client = MeiliSearchClient('http://127.0.0.1:7700', 'masterKey');
// An index where books are stored.
var index = await client.createIndex('books', primaryKey: 'book_id');
var documents = [
{'book_id': 123, 'title': 'Pride and Prejudice'},
{'book_id': 456, 'title': 'Le Petit Prince'},
{'book_id': 1, 'title': 'Alice In Wonderland'},
{'book_id': 1344, 'title': 'The Hobbit'},
{'book_id': 4, 'title': 'Harry Potter and the Half-Blood Prince'},
{'book_id': 42, 'title': 'The Hitchhiker\'s Guide to the Galaxy'}
];
// Add documents into index we just created.
var update = await index.addDocuments(documents);
// Search
var result = await index.search('prience');
}