-
Notifications
You must be signed in to change notification settings - Fork 2
/
filterscorer.go
39 lines (31 loc) · 1022 Bytes
/
filterscorer.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
27
28
29
30
31
32
33
34
35
36
37
38
39
package search
import (
"github.com/geange/lucene-go/core/types"
)
// A FilterScorer contains another Scorer, which it uses as its basic source of data,
// possibly transforming the data along the way or providing additional functionality.
// The class FilterScorer itself simply implements all abstract methods of Scorer with versions
// that pass all requests to the contained scorer. Subclasses of FilterScorer may further
// override some of these methods and may also provide additional methods and fields.
type FilterScorer struct {
*BaseScorer
in Scorer
}
func newFilterScorer(in Scorer) *FilterScorer {
return &FilterScorer{
BaseScorer: NewScorer(in.GetWeight()),
in: in,
}
}
func (f *FilterScorer) Score() (float64, error) {
return f.in.Score()
}
func (f *FilterScorer) DocID() int {
return f.in.DocID()
}
func (f *FilterScorer) Iterator() types.DocIdSetIterator {
return f.in.Iterator()
}
func (f *FilterScorer) TwoPhaseIterator() TwoPhaseIterator {
return f.in.TwoPhaseIterator()
}