Column.rank

This commit is contained in:
Gwendal Roué committed 2016-10-17 08:12:30 +02:00
1 parent 3be2047c9c
commit cb6d727664
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -310,4 +310,9 @@
return self
}
}
extension Column {
/// The FTS5 rank column
public static let rank = Column("rank")
}
#endif
+1 -1
View File
@@ -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)