Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
RelevanceOrder.cs
1
using
System;
2
using
System.Collections.Generic;
3
4
namespace
Waher.Persistence.FullTextSearch.Orders
5
{
9
public
class
RelevanceOrder
: IComparer<MatchInformation>
10
{
14
public
RelevanceOrder
()
15
{
16
}
17
21
public
int
Compare
(
MatchInformation
x,
MatchInformation
y)
22
{
23
int
i = (int)(y.
NrDistinctTokens
- x.
NrDistinctTokens
);
24
if
(i != 0)
25
return
i;
26
27
long
l = (long)(y.
NrTokens
- x.
NrTokens
);
28
29
if
(l < 0)
30
return
-1;
31
else
if
(l > 0)
32
return
1;
33
34
return
y.
Timestamp
.CompareTo(x.
Timestamp
);
35
}
36
}
37
}
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.RelevanceOrder
Orders entries based on relevance.
Definition:
RelevanceOrder.cs:10
Waher.Persistence.FullTextSearch.Orders.RelevanceOrder.RelevanceOrder
RelevanceOrder()
Orders entries based on relevance.
Definition:
RelevanceOrder.cs:14
Waher.Persistence.FullTextSearch.Orders.RelevanceOrder.Compare
int Compare(MatchInformation x, MatchInformation y)
IComparer<MatchInformation>.Compare
Definition:
RelevanceOrder.cs:21
Waher.Persistence.FullTextSearch.Orders
Definition:
MatchInformation.cs:5
IoTGateway
Persistence
Waher.Persistence.FullTextSearch
Orders
RelevanceOrder.cs
Generated by
1.9.5