From cb6d727664dd134e40ad3d467dabec97d93f1978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 17 Oct 2016 08:12:30 +0200 Subject: [PATCH] Column.rank --- GRDB/FTS/FTS5.swift | 5 +++++ README.md | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/GRDB/FTS/FTS5.swift b/GRDB/FTS/FTS5.swift index 24d9ded5e..74d104f17 100644 --- a/GRDB/FTS/FTS5.swift +++ b/GRDB/FTS/FTS5.swift @@ -310,4 +310,9 @@ return self } } + + extension Column { + /// The FTS5 rank column + public static let rank = Column("rank") + } #endif diff --git a/README.md b/README.md index 4eb31fdde..fc0065f6e 100644 --- a/README.md +++ b/README.md @@ -3725,7 +3725,7 @@ let documents = Document.fetchAll(db, arguments: [pattern]) // Query Interface -let documents = Document.matching(pattern).order(Column("rank")).fetchAll(db) +let documents = Document.matching(pattern).order(Column.rank).fetchAll(db) ``` For more information about the ranking algorithm, as well as extra options, read [Sorting by Auxiliary Function Results](https://www.sqlite.org/fts5.html#sorting_by_auxiliary_function_results)