2using System.Collections.Generic;
4using System.Threading.Tasks;
21 this.Optional =
false;
23 this.OrderCategory =
int.MaxValue;
24 this.OrderComplexity =
int.MaxValue;
74 public override bool Equals(
object obj)
79 (c = this.
Keywords.Length) != Sequence.Keywords.Length)
84 for (i = 0; i < c; i++)
96 StringBuilder sb =
new StringBuilder();
116 return sb.ToString();
126 Dictionary<ulong, ObjectReference> ExpectedDocIndex =
null;
127 IEnumerable<KeyValuePair<string, TokenReferences>> Records;
139 if (ExpectedDocIndex is
null)
141 ExpectedDocIndex =
new Dictionary<ulong, ObjectReference>();
143 foreach (KeyValuePair<string, TokenReferences> Rec
in Records)
145 c = Rec.Value.ObjectReferences.Length;
146 for (i = 0; i < c; i++)
148 Ref = await
Process.TryGetObjectReference(Rec.Value.ObjectReferences[i],
true);
160 ExpectedDocIndex[Key + 1] = Ref;
168 Dictionary<ulong, ObjectReference> ExpectedDocIndex2 =
new Dictionary<ulong, ObjectReference>();
170 foreach (KeyValuePair<string, TokenReferences> Rec
in Records)
172 c = Rec.Value.ObjectReferences.Length;
173 for (i = 0; i < c; i++)
175 Ref = await
Process.TryGetObjectReference(Rec.Value.ObjectReferences[i],
false);
187 if (ExpectedDocIndex.ContainsKey(Key))
188 ExpectedDocIndex2[Key + 1] = Ref;
194 ExpectedDocIndex = ExpectedDocIndex2;
197 if (ExpectedDocIndex.Count == 0)
198 return new KeyValuePair<string, TokenReferences>[0];
201 if (ExpectedDocIndex is
null)
202 return new KeyValuePair<string, TokenReferences>[0];
204 c = ExpectedDocIndex.Count;
205 ulong[] ObjectReferences =
new ulong[c];
206 uint[] Counts =
new uint[c];
207 DateTime[] Timestamps =
new DateTime[c];
212 ObjectReferences[i] = Ref2.
Index;
219 return new KeyValuePair<string, TokenReferences>[]
221 new KeyValuePair<string, TokenReferences>(this.
ToString(),
225 ObjectReferences = ObjectReferences,
226 Timestamps = Timestamps,
239 IEnumerable<KeyValuePair<string, TokenReferences>> Records = await this.
GetTokenReferences(Process);
241 foreach (KeyValuePair<string, TokenReferences> Rec
in Records)
243 string Token = Rec.Key;
248 for (j = 0; j < d; j++)
266 Count = References.
Counts[j],
277 LinkedList<ulong> ToRemove =
null;
283 if (ToRemove is
null)
284 ToRemove =
new LinkedList<ulong>();
290 if (!(ToRemove is
null))
297 if (
Process.ReferencesByObject.Count == 0)
Abstract base class for keywords.
virtual bool Ignore
If keyword should be ignored.
virtual bool Required
If keyword is required
virtual int OrderCategory
Order category of keyword
virtual bool Optional
If keyword is optional
abstract Task< IEnumerable< KeyValuePair< string, TokenReferences > > > GetTokenReferences(SearchProcess Process)
Gets available token references.
abstract new string ToString()
Contains information about a search process.
Represents a sequence of keywords.
SequenceOfKeywords(params Keyword[] Keywords)
Represents a sequence of keywords.
override bool Equals(object obj)
override async Task< bool > Process(SearchProcess Process)
Processes the keyword in a search process.
override async Task< IEnumerable< KeyValuePair< string, TokenReferences > > > GetTokenReferences(SearchProcess Process)
Gets available token references.
override int OrderCategory
Order category of keyword
Keyword[] Keywords
Keyword
override string ToString()
override bool Optional
If keyword is optional
override bool Required
If keyword is required
override bool Ignore
If keyword should be ignored.
override int OrderComplexity
Order complexity (within category) of keyword
Contains a reference to an indexed object.
DateTime Indexed
When object was indexed.
ulong Index
Reference number to use in full-text-index.
Contains matching information about a document in a search.
Represents a token and a corresponding occurrence count.
uint[] DocIndex
Index inside document of each occurrence.
Contains a reference to a token.
Contains a sequence of object references that include the token in its indexed text properties.
DateTime[] Timestamps
Timestamps when corresponding object refernces were indexed.
uint[] Counts
Token counts for respective object reference.
ulong[] ObjectReferences
References to objects containing the token.
uint LastBlock
Index to last block in index representing the same token.