-
Notifications
You must be signed in to change notification settings - Fork 2
/
totalhits.go
26 lines (22 loc) · 974 Bytes
/
totalhits.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package search
// TotalHits
// Description of the total number of hits of a query.
// The total hit count can't generally be computed accurately without visiting all matches,
// which is costly for queries that match lots of documents. Given that it is often enough
// to have a lower bounds of the number of hits, such as "there are more than 1000 hits",
// Lucene has options to stop counting as soon as a threshold has been reached in order to
// improve query times.
type TotalHits struct {
Value int64
Relation TotalHitsRelation
}
func NewTotalHits(value int64, relation TotalHitsRelation) *TotalHits {
return &TotalHits{Value: value, Relation: relation}
}
// TotalHitsRelation
// How the value should be interpreted.
type TotalHitsRelation int
const (
EQUAL_TO = TotalHitsRelation(iota) // The total hit count is equal to value.
GREATER_THAN_OR_EQUAL_TO // The total hit count is greater than or equal to value.
)