sqlite_rank 0.1.0 copy "sqlite_rank: ^0.1.0" to clipboard
sqlite_rank: ^0.1.0 copied to clipboard

A dart implementation of the rank function for SQLite FTS4 described here https://www.sqlite.org/fts3.html#appendix_a

example/main.dart

import 'dart:typed_data';
import 'package:sqlite_rank/sqlite_rank.dart';


/// The SQLite matchinfo function returns a byte array representing 32-bit unsigned integers 
/// in machine byte-order in dart they are mapped to a [Uint8List]
Uint8List matchinfoOne = Uint8List.fromList(
  [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0]); 
Uint8List matchinfoTwo = Uint8List.fromList(
  [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0]); 

/// The [rank] function calculates a rank value from the matchinfo array 
final resultOne = rank(matchinfoOne);

/// If you're querying more than one column, you can specify a [columnWeight] weight for each column
final resultTwo = rank(matchinfoTwo, [0.2, 0.7]);
0
likes
40
pub points
0%
popularity

Publisher

unverified uploader

A dart implementation of the rank function for SQLite FTS4 described here https://www.sqlite.org/fts3.html#appendix_a

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on sqlite_rank