Skip to content

Instantly share code, notes, and snippets.

@blaugold
Last active November 21, 2021 18:21
Show Gist options
  • Save blaugold/a5a10872a1799e281005b2e7419d8d52 to your computer and use it in GitHub Desktop.
Save blaugold/a5a10872a1799e281005b2e7419d8d52 to your computer and use it in GitHub Desktop.
Future<void> createNoteFtsIndex() async {
// Existing documents will be indexed when an index is created.
await database.createIndex(
// Any existing index, with the same name, will be replaced with
// a new index, with the new configuration.
'note-fts',
FullTextIndexConfiguration(
// We want both the title and body of the note to be indexed.
['title', 'body'],
// By selecting the language, that is primarily used in the
// indexed fields, users will get better search results.
language: FullTextLanguage.english,
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment