SearchableInitialCollectionMixin<T> mixin

Mix-in to search for ModelInitialCollection.

This can be mixed in with with to make mock data searchable and "display only specific strings" when querying collections.

Stores Bigram data for search in searchValueFieldKey.

buildSearchText creates a string to be searched. If you want to search multiple items, combine all strings and return them as a single string.

ModelInitialCollectionを検索対象にするためのミックスイン。

これをwithでミックスインすることでモックデータを検索対象にしてコレクションでのクエリ時に「特定の文字列のみ表示する」といったことを実現することができます。

searchValueFieldKeyに検索用のBigramのデータを格納します。

buildSearchTextで検索対象の文字列を作成します。複数の項目を検索対象にしたい場合、すべての文字列を合成し1つの文字列として返してください。

String buildSearchText(User user){
  return user.name + user.description;
}

A collection that performs searches should have SearchableCollectionMixin mixed in so that it can be searched. Then use SearchableCollectionMixin.search to perform the search.

検索を行うコレクションにはSearchableCollectionMixinをミックスインして検索できるようにします。 その後、SearchableCollectionMixin.searchを利用して検索を行います。

Superclass Constraints

Properties

hashCode int
The hash code for this object.
no setterinherited
path String
Path to the collection itself.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchValueFieldKey String
The field with this key contains the Bigram data for the search.
no setter
value Map<String, T>
ID and value Map.
finalinherited

Methods

buildSearchText(T value) String
Creates a string to be searched. If you want to search multiple items, combine all strings and return them as a single string.
filterOnSave(DynamicMap rawData, T value) DynamicMap
Methods for filtering data as it is stored.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap(T value) DynamicMap
Parse for Json.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Constants

defaultSearchValueFieldKey → const String
Field key for default search.