Sherlock class

Efficient and customizable search engine for local data.

More

Usage information on the README.md

Constructors

Sherlock({required List<Element> elements, PriorityMap priorities = const {'*' : 1}, NormalizationSettings normalization = const NormalizationSettings.defaults()})
Creates a new Sherlock object to search in elements.

Properties

elements List<Element>
The local data organised in a list of maps. It's where researches are done.
final
hashCode int
The hash code for this object.
no setterinherited
normalization NormalizationSettings
See NormalizationSettings's documentation.
final
priorities PriorityMap
Map (column identifier as the key, priority number as the value) defining the importance of each column in the results.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query({String where = '*', required String regex, NormalizationSettings? specificNormalization}) Future<List<Result>>
Searches for values matching with the given regular expression in the column(s) where.
queryBool({String where = '*', required bool fn(dynamic value)}) Future<List<Result>>
Searches for values corresponding to a boolean expression in the column(s) where.
queryExist({required String where, required String what}) Future<List<Result>>
Searches for what existing in the where column when exists.
queryMatch({String where = '*', required dynamic match, NormalizationSettings? specificNormalization}) Future<List<Result>>
Searches for values equal to match in the column(s) where.
Searches for values matching more or less with the input.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

processUnique({required List<Element> elements, PriorityMap priorities = const {'*' : 1}, NormalizationSettings normalization = const NormalizationSettings.defaults(), required Future<List<Result>> fn(Sherlock sherlock)}) Future<List<Result>>
Creates a unique Sherlock object which cannot be used outside this function and perform queries.