Пример #1
0
        private static string GetMatches(WordIndex index, string word)
        {
            ShortSet results = new ShortSet(ushort.MaxValue);

            index.WhereMatches(word, results);
            return(String.Join(", ", results.Values));
        }
Пример #2
0
        public override void TryWhere(Operator op, ByteBlock value, ShortSet result, ExecutionDetails details)
        {
            // Evaluate Matches and MatchesExact using the index
            if (op == Operator.MatchesExact)
            {
                ByteBlock lower = value.Copy();
                lower.ToLowerInvariant();

                _index.WhereMatchExact(lower, result);
            }
            else if (op == Operator.Matches)
            {
                ByteBlock lower = value.Copy();
                lower.ToLowerInvariant();

                _index.WhereMatches(lower, result);
            }
            else
            {
                // For clauses we don't handle, allow the base column to try to handle it.
                base.TryWhere(op, value, result, details);
            }
        }