word static method

TsQuery word(
  1. String text, {
  2. Iterable<TsWeight>? weights,
  3. bool prefix = false,
})

Implementation

static TsQuery word(
  String text, {
  Iterable<TsWeight>? weights,
  bool prefix = false,
}) {
  final weightsSet = weights?.toSet();
  final weightByte = (weightsSet == null || weightsSet.isEmpty)
      ? 0
      : weightsSet.fold(0, (p, e) => p | e._queryMask);

  return _WordTsQuery._(text, weightByte, prefix ? 1 : 0);
}