Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
OccurrencesOrder.cs
1
using
System;
2
using
System.Collections.Generic;
3
4
namespace
Waher.Persistence.FullTextSearch.Orders
5
{
9
public
class
OccurrencesOrder
: IComparer<MatchInformation>
10
{
14
public
OccurrencesOrder
()
15
{
16
}
17
21
public
int
Compare
(
MatchInformation
x,
MatchInformation
y)
22
{
23
long
l = (long)(y.
NrTokens
- x.
NrTokens
);
24
25
if
(l < 0)
26
return
-1;
27
else
if
(l > 0)
28
return
1;
29
30
int
i = (int)(y.
NrDistinctTokens
- x.
NrDistinctTokens
);
31
if
(i != 0)
32
return
i;
33
34
return
y.
Timestamp
.CompareTo(x.
Timestamp
);
35
}
36
37
38
}
39
}
Waher.Persistence.FullTextSearch.Orders.MatchInformation
Contains matching information about a document in a search.
Definition:
MatchInformation.cs:10
Waher.Persistence.FullTextSearch.Orders.MatchInformation.Timestamp
DateTime Timestamp
Timestamp
Definition:
MatchInformation.cs:37
Waher.Persistence.FullTextSearch.Orders.MatchInformation.NrTokens
ulong NrTokens
Number of tokens found.
Definition:
MatchInformation.cs:32
Waher.Persistence.FullTextSearch.Orders.MatchInformation.NrDistinctTokens
uint NrDistinctTokens
Number of distinct tokens found.
Definition:
MatchInformation.cs:27
Waher.Persistence.FullTextSearch.Orders.OccurrencesOrder
Orders entries based on occurrences of keywords.
Definition:
OccurrencesOrder.cs:10
Waher.Persistence.FullTextSearch.Orders.OccurrencesOrder.Compare
int Compare(MatchInformation x, MatchInformation y)
IComparer<MatchInformation>.Compare
Definition:
OccurrencesOrder.cs:21
Waher.Persistence.FullTextSearch.Orders.OccurrencesOrder.OccurrencesOrder
OccurrencesOrder()
Orders entries based on occurrences of keywords.
Definition:
OccurrencesOrder.cs:14
Waher.Persistence.FullTextSearch.Orders
Definition:
MatchInformation.cs:5
IoTGateway
Persistence
Waher.Persistence.FullTextSearch
Orders
OccurrencesOrder.cs
Generated by
1.9.5