1using System.Collections.Generic;
2using System.Text.RegularExpressions;
3using System.Threading.Tasks;
20 this.Parsed =
new Regex(
Expression, RegexOptions.IgnoreCase | RegexOptions.Singleline);
54 public override bool Equals(
object obj)
73 LinkedList<KeyValuePair<string, TokenReferences>> Result =
new LinkedList<KeyValuePair<string, TokenReferences>>();
75 if (
string.IsNullOrEmpty(Preamble))
77 string[] Keys = await
Process.Index.GetKeysAsync();
79 foreach (
string Key
in Keys)
81 Match M = this.
Parsed.Match(Key);
82 if (M.Success && M.Index == 0 && M.Length == Key.Length)
84 foreach (KeyValuePair<string, object> P
in await
Process.Index.GetEntriesAsync(Key, Key +
"!"))
87 Result.AddLast(
new KeyValuePair<string, TokenReferences>(P.Key, References));
94 char[] Characters = Preamble.ToCharArray();
95 Characters[Characters.Length - 1]++;
96 string ToExclusive =
new string(Characters);
98 KeyValuePair<string, object>[] Records = await
Process.Index.GetEntriesAsync(Preamble, ToExclusive);
100 foreach (KeyValuePair<string, object> Rec
in Records)
102 Match M = this.
Parsed.Match(Rec.Key);
103 if (M.Success && M.Index == 0 && M.Length == Rec.Key.Length && Rec.Value is
TokenReferences References)
104 Result.AddLast(
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.