FullTextSearch<T> class
Matches items in an array with user-provided search string. The input is split into multiple terms, and there is an option to ensure that each term is matched within the tokens. term The search term. Will be tokenized internally items The list of items to search against isMatchAll Whether or not we should enforce that all terms in term are matched. eg. term="Eric Martineau" should match on "Eric" AND "Martineau" isStartsWith Whether the search will require the search term to match the beginning of the value token or not ignoreCase Whether to ignore case when searching limit The number of results to return tokenize Determines how each item in items should produce searchable tokens
Constructors
-
FullTextSearch({required String term, required Iterable<
T> items, bool isMatchAll = false, bool isStartsWith = true, bool ignoreCase = true, int? limit, required Tokenizer<T> tokenize, List<SearchScoring> ? additionalScorers, List<TermMatcher> ? additionalMatchers}) -
This constructor applies default scoring, but also allows you to add additional scoring rules
Matches items in an array with user-provided search string. The input is split into multiple terms, and there is an option
to ensure that each term is matched within the tokens.
termThe search term. Will be tokenized internallyitemsThe list of items to search againstisMatchAllWhether or not we should enforce that all terms intermare matched. eg. term="Eric Martineau" should match on "Eric" AND "Martineau"isStartsWithWhether the search will require the search term to match the beginning of the value token or notignoreCaseWhether to ignore case when searchinglimitThe number of results to returntokenizeDetermines how each item initemsshould produce searchable tokensadditionalScorersOther scorers to use in addition to the defaults -
FullTextSearch.ofStream({required String term, required Stream<
T> ? items, bool isMatchAll = false, bool isStartsWith = true, bool ignoreCase = true, int? limit, required Tokenizer<T> tokenize, List<SearchScoring> ? additionalScorers, List<TermMatcher> ? additionalMatchers}) -
FullTextSearch.scoring({required String term, required Stream<
T> items, bool isMatchAll = false, bool isStartsWith = true, bool ignoreCase = true, int? limit, required Tokenizer<T> tokenize, List<SearchScoring> ? scorers, List<TermMatcher> ? matchers}) -
Matches items in an array with user-provided search string. The input is split into multiple terms, and there is an option
to ensure that each term is matched within the tokens.
termThe search term. Will be tokenized internallyitemsThe list of items to search againstisMatchAllWhether or not we should enforce that all terms intermare matched. eg. term="Eric Martineau" should match on "Eric" AND "Martineau"isStartsWithWhether the search will require the search term to match the beginning of the value token or notignoreCaseWhether to ignore case when searchinglimitThe number of results to returntokenizeDetermines how each item initemsshould produce searchable tokensscorersScorers
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- ignoreCase → bool
-
final
- isMatchAll → bool
-
final
- isStartsWith → bool
-
final
-
items
→ Stream<
T> -
final
- limit → int?
-
final
- log → Logger
-
final
-
matchers
→ List<
TermMatcher> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
scorers
→ List<
SearchScoring> -
final
- term → String
-
final
-
tokenize
→ Tokenizer<
T> -
final
Methods
-
execute(
) → Future< List< TermSearchResult< >T> > - Executes a search and applies isMatchAll, or sorting rules, depending on the configuration of this FullTextSearch instance
-
findResults(
) → Future< List< T> > - Executes a search and finds the results. See also execute
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
results(
) → Stream< TermSearchResult< T> > - Executes a search and returns a stream of individual term results, unsorted and unfiltered.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited