सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
Flutter Mimir एक प्रतिक्रियाशील NoSQL डेटाबेस है जो Flutter एप्लिकेशन के लिए डिज़ाइन किया गया है, जिसमें शक्तिशाली, टाइपो-सहिष्णु पूर्ण-टेक्स्ट सर्च और घोषणात्मक क्वेरी सिंटैक्स शामिल है। यह वास्तविक समय में डेटा सिंक्रनाइज़ेशन और कई प्लेटफॉर्मों पर कुशल स्थानीय स्टोरेज की अनुमति देता है। इसके सरल API और आंतरिक सर्च क्षमताओं के साथ, यह डायनामिक डेटा सेट को प्रबंधित करने को सरल बनाता है जबकि प्रदर्शन और प्रतिक्रियाशीलता बनाए रखता है। तेज़, खोजयोग्य और प्रतिक्रियाशील डेटा हैंडलिंग की आवश्यकता वाले एप्लिकेशन के लिए आदर्श है।
उपयोग
रियल-टाइम नोट-टेकिंग ऐप्स
खोजयो जा सकने वाले कार्य प्रबंधक
सामग्री-भारी मोबाइल एप्लिकेशन
ऑफलाइन-प्रथम एप्लिकेशंस
व्यक्तिगत अनुशंसा प्रणाली
मुख्य विशेषताएँ
टाइपो-सहिष्णु पूर्ण-पाठ खोज
घोषणात्मक प्रश्न सिंटैक्स
प्रतिक्रियाशील डेटा अपडेट
क्रॉस-प्लेटफ़ॉर्म समर्थन
स्थानीय स्थायी भंडारण
इनके लिए उपयुक्त
प्रतिक्रियाशील एप्लिकेशन बना रहे विकासकर्ता
मजबूत खोज कार्यक्षमता की आवश्यकता वाले ऐप्स
ऑफलाइन डेटा पर्सिस्टेंस की आवश्यकता वाले प्रोजेक्ट
सरल NoSQL एकीकरण की तलाश में टीमें
डायनामिक कंटेंट वाले फ्लटर ऐप्स
विचार योग्य बातें
नए खोज पैटर्न सीखने की आवश्यकता हो सकती है
बड़े डेटासेट प्रदर्शन को प्रभावित कर सकते हैं
परिपक्व डेटाबेस की तुलना में सीमित दस्तावेज़
जटिल संबंधात्मक संचालन के लिए उपयुक्त नहीं
प्रारंभिक सेटअप में कॉन्फ़िगरेशन ट्यूनिंग की आवश्यकता हो सकती है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
A batteries-included NoSQL database for Dart & Flutter based on an embedded
Meilisearch instance.
Features
🔎 Typo tolerant and relevant full-text search with no extra configuration needed
🔥 Blazingly fast search and reads (written in Rust)
🤝 Flutter friendly with a super easy-to-use API (see demo below!)
With Flutter, you can get started with as little as:
// Get an "index" to store our moviesfinal instance = awaitMimir.defaultInstance;
final index = instance.getIndex('movies');
// Add movies to our indexawait index.addDocuments(myMovies);
// Perform a search!final results = await index.search(query: 'jarrassic par'); // returns Jurassic Park!
A collection of commonly used APIs ready for copy-paste into your application.
Note: unless otherwise stated, all asynchronous methods exposed in Mimir are fallible
and synchronous methods are infallible.
The methods are fail-fast, so you should be aware of any issues early on during development.
Getting & Creating an Index
// With Flutter (flutter_mimir)final instance = awaitMimir.defaultInstance;
// Dart-only (just mimir)final instance = awaitMimir.getInstance(path: instanceDirectory);
// Get an index (creates one lazily if not already created)final index = instance.getIndex('movies');
// Or, specify some default settings and open the index eagerly// If you have some settings you want to specify in advance, use openIndex!final index = await instance.openIndex('movies', primaryKey: 'CustomIdField');
Configuring an Index
await index.updateSettings(
// The primary key (PK) is the "ID field" of documents added to mimir.// When null, it is automatically inferred for you, but sometimes you may// need to specify it manually. See the Important Caveats section for more.
primaryKey: null,
// Fields in documents that are included in full-text search.// Use null, the default, to search all fields
searchableFields: <String>[],
// Fields in documents that can be queried/filtered by.// You probably don't need to change this; it is automatically// updated for you.
filterableFields: <String>[],
// Fields in documents that can be sorted by in searches/queries.// You probably don't need to change this; it is automatically// updated for you.
sortableFields: <String>[],
// The ranking rules of this index, see:// https://docs.meilisearch.com/reference/api/settings.html#ranking-rules
rankingRules: <String>[],
// The stop words of this index, see:// https://docs.meilisearch.com/reference/api/settings.html#stop-words
stopWords: <String>[],
// A list of synonyms to link words with the same meaning together.// Note: in most cases, you probably want to add synonyms both ways, like below:
synonyms: <Synonyms>[
(
word: 'automobile',
synonyms: ['vehicle'],
),
(
word: 'vehicle',
synonyms: ['automobile'],
),
],
// Whether to enable typo tolerance in searches.
typosEnabled: true,
// The minimum size of a word that can have 1 typo.// See minWordSizeForTypos.oneTypo here:// https://docs.meilisearch.com/reference/api/settings.html#typo-tolerance-object
minWordSizeForOneTypo: 5,
// The minimum size of a word that can have 2 typos.// See minWordSizeForTypos.twoTypos here:// https://docs.meilisearch.com/reference/api/settings.html#typo-tolerance-object
minWordSizeForTwoTypos: 9,
// Words that disallow typos. See disableOnWords here:// https://docs.meilisearch.com/reference/api/settings.html#typo-tolerance-object
disallowTyposOnWords: <String>[],
// Fields that disallow typos. See disableOnAttributes here:// https://docs.meilisearch.com/reference/api/settings.html#typo-tolerance-object
disallowTyposOnFields: <String>[],
);
Manipulating Documents
// Adding documents (replaces any documents with the same id)await index.addDocument(document);
await index.addDocuments(documents);
// Replacing all documentsawait index.setDocuments(documents);
// Deleting documentsawait index.deleteDocument(id);
await index.deleteDocuments(ids);
await index.deleteAllDocuments();
// Getting documents (not querying--see next section!)final docOrNull = await index.getDocument(someId);
final allDocs = await index.getAllDocuments();
final allDocsStream = index.documents;
Searching/Querying
// Getting a stream of results (very useful in Flutter!)// Same arguments as index.search; see belowfinal documentsStream = index.searchStream(...);
// Performing a search/query (using movies here)!final movies = index.search(
// The string to use for full-text search. Can be user-supplied.// To do a regular database query without full-text search, leave this null.
query: 'some wordz with typoes to saerch for',
// The filter used to filter results in a full-text search or query.// See the next section; this is a very handy feature in mimir.// Set to null to not filter out any documents.
filter: Mimir.where('director', isEqualTo: 'Alfred Hitchcock'),
// The fields to sort by (in ascending or descending order).// Can be left as null to sort by relevance (to the query text)!
sortBy: [
// Sort by year, newest to oldestSortBy.desc('year'),
// In case 2+ documents share the same year, sort by increasing profit nextSortBy.asc('profit'),
],
// If you want to limit the number of results you get, use the resultsLimit.// Defaults to null, which means return all matches.
resultsLimit: null,
// Defaults to null, see https://docs.meilisearch.com/reference/api/search.html#matching-strategy
matchingStrategy: null,
);
Filtering Search/Query Results
Here are the methods you need to be aware of:
Mimir.or(subFilters) creates an "or" filter (like ||) of the sub-filters
Mimir.and(subFilters) creates an "and" filter (like &&) of the sub-filters
Mimir.not(subFilter) creates a "not" filter (like !someCondition) of the sub-filter
Mimir.where(condition) creates a single filter from a given condition.
The above can be composed together to create powerful, declarative queries!
Say our Dart boolean logic is (formatted to show intent):