4using System.Threading.Tasks;
22 this.Optional =
false;
24 this.OrderCategory =
int.MaxValue;
25 this.OrderComplexity =
int.MaxValue;
75 public override bool Equals(
object obj)
80 (c = this.
Keywords.Length) != Sequence.Keywords.Length)
85 for (i = 0; i < c; i++)
97 StringBuilder sb =
new StringBuilder();
117 return sb.ToString();
127 Dictionary<ulong, ObjectReference> ExpectedDocIndex =
null;
128 IEnumerable<KeyValuePair<string, TokenReferences>> Records;
140 if (ExpectedDocIndex is
null)
142 ExpectedDocIndex =
new Dictionary<ulong, ObjectReference>();
144 foreach (KeyValuePair<string, TokenReferences> Rec
in Records)
146 c = Rec.Value.ObjectReferences.Length;
147 for (i = 0; i < c; i++)
149 Ref = await
Process.TryGetObjectReference(Rec.Value.ObjectReferences[i],
true);
161 ExpectedDocIndex[Key + 1] = Ref;
169 Dictionary<ulong, ObjectReference> ExpectedDocIndex2 =
new Dictionary<ulong, ObjectReference>();
171 foreach (KeyValuePair<string, TokenReferences> Rec
in Records)
173 c = Rec.Value.ObjectReferences.Length;
174 for (i = 0; i < c; i++)
176 Ref = await
Process.TryGetObjectReference(Rec.Value.ObjectReferences[i],
false);
188 if (ExpectedDocIndex.ContainsKey(Key))
189 ExpectedDocIndex2[Key + 1] = Ref;
195 ExpectedDocIndex = ExpectedDocIndex2;
198 if (ExpectedDocIndex.Count == 0)
199 return Array.Empty<KeyValuePair<string, TokenReferences>>();
202 if (ExpectedDocIndex is
null)
203 return Array.Empty<KeyValuePair<string, TokenReferences>>();
205 c = ExpectedDocIndex.Count;
206 ulong[] ObjectReferences =
new ulong[c];
207 uint[] Counts =
new uint[c];
208 DateTime[] Timestamps =
new DateTime[c];
213 ObjectReferences[i] = Ref2.
Index;
220 return new KeyValuePair<string, TokenReferences>[]
222 new KeyValuePair<string, TokenReferences>(this.
ToString(),
226 ObjectReferences = ObjectReferences,
227 Timestamps = Timestamps,
240 IEnumerable<KeyValuePair<string, TokenReferences>> Records = await this.
GetTokenReferences(Process);
242 foreach (KeyValuePair<string, TokenReferences> Rec
in Records)
244 string Token = Rec.Key;
249 for (j = 0; j < d; j++)
267 Count = References.
Counts[j],
284 if (ToRemove is
null)
291 if (!(ToRemove is
null))
298 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.
A chunked list is a linked list of chunks of objects of type T .