2using System.Text.RegularExpressions;
3using System.Threading.Tasks;
21 this.Parsed =
new Regex(
Expression, RegexOptions.IgnoreCase | RegexOptions.Singleline);
55 public override bool Equals(
object obj)
76 if (
string.IsNullOrEmpty(Preamble))
78 string[] Keys = await
Process.Index.GetKeysAsync();
80 foreach (
string Key
in Keys)
82 Match M = this.
Parsed.Match(Key);
83 if (M.Success && M.Index == 0 && M.Length == Key.Length)
85 foreach (KeyValuePair<string, object> P
in await
Process.Index.GetEntriesAsync(Key, Key +
"!"))
88 Result.
Add(
new KeyValuePair<string, TokenReferences>(P.Key, References));
95 char[] Characters = Preamble.ToCharArray();
96 Characters[Characters.Length - 1]++;
97 string ToExclusive =
new string(Characters);
99 KeyValuePair<string, object>[] Records = await
Process.Index.GetEntriesAsync(Preamble, ToExclusive);
101 foreach (KeyValuePair<string, object> Rec
in Records)
103 Match M = this.
Parsed.Match(Rec.Key);
104 if (M.Success && M.Index == 0 && M.Length == Rec.Key.Length && Rec.Value is
TokenReferences References)
105 Result.
Add(
new KeyValuePair<string, TokenReferences>(Rec.Key, References));
This filter selects objects that have a named field matching a given regular expression.
static string GetRegExConstantPrefix(string RegularExpression, Regex Regex)
Gets any constant prefix from a regular expression. This prefix
Full-text search module, controlling the life-cycle of the full-text-search engine.
Abstract base class for keywords.
virtual async Task< bool > Process(SearchProcess Process)
Processes the keyword in a search process.
Represents a wildcard keyword.
string Expression
String representation of regex expression.
override int OrderComplexity
Order complexity (within category) of keyword
RegexKeyword(string Expression)
Represents a wildcard keyword.
override bool Ignore
If keyword should be ignored.
override bool Equals(object obj)
override string ToString()
override async Task< IEnumerable< KeyValuePair< string, TokenReferences > > > GetTokenReferences(SearchProcess Process)
Gets available token references.
Contains information about a search process.
Contains a sequence of object references that include the token in its indexed text properties.
A chunked list is a linked list of chunks of objects of type T .
void Add(T Item)
Adds an item to the collection.