Update server dependencies
This commit is contained in:
parent
fb8fec38ff
commit
de36fe682a
883 changed files with 147940 additions and 68404 deletions
27
vendor/github.com/blevesearch/bleve/search/util.go
generated
vendored
27
vendor/github.com/blevesearch/bleve/search/util.go
generated
vendored
|
@ -40,3 +40,30 @@ func MergeTermLocationMaps(rv, other TermLocationMap) TermLocationMap {
|
|||
}
|
||||
return rv
|
||||
}
|
||||
|
||||
func MergeFieldTermLocations(dest []FieldTermLocation, matches []*DocumentMatch) []FieldTermLocation {
|
||||
n := len(dest)
|
||||
for _, dm := range matches {
|
||||
n += len(dm.FieldTermLocations)
|
||||
}
|
||||
if cap(dest) < n {
|
||||
dest = append(make([]FieldTermLocation, 0, n), dest...)
|
||||
}
|
||||
|
||||
for _, dm := range matches {
|
||||
for _, ftl := range dm.FieldTermLocations {
|
||||
dest = append(dest, FieldTermLocation{
|
||||
Field: ftl.Field,
|
||||
Term: ftl.Term,
|
||||
Location: Location{
|
||||
Pos: ftl.Location.Pos,
|
||||
Start: ftl.Location.Start,
|
||||
End: ftl.Location.End,
|
||||
ArrayPositions: append(ArrayPositions(nil), ftl.Location.ArrayPositions...),
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return dest
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue