mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-07 06:03:09 -06:00
Remove unneeded method
This commit is contained in:
parent
7b5baa6da8
commit
36f0034263
|
|
@ -67,13 +67,8 @@ func (f *Search) Close() error {
|
||||||
return f.FulltextIndex.Close()
|
return f.FulltextIndex.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
// FulltextIndex indexes a given element
|
// Index indexes the given elements
|
||||||
func (f *Search) Index(e IndexElement) error {
|
func (f *Search) Index(elements ...IndexElement) error {
|
||||||
return f.FulltextIndex.Index(e.EventID, e)
|
|
||||||
}
|
|
||||||
|
|
||||||
// BatchIndex indexes the given elements
|
|
||||||
func (f *Search) BatchIndex(elements []IndexElement) error {
|
|
||||||
batch := f.FulltextIndex.NewBatch()
|
batch := f.FulltextIndex.NewBatch()
|
||||||
|
|
||||||
for _, element := range elements {
|
for _, element := range elements {
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ func mustAddTestData(t *testing.T, fts *fulltext.Search, firstStreamPos int64) (
|
||||||
}
|
}
|
||||||
e.SetContentType(gomatrixserverlib.MRoomTopic)
|
e.SetContentType(gomatrixserverlib.MRoomTopic)
|
||||||
batchItems = append(batchItems, e)
|
batchItems = append(batchItems, e)
|
||||||
if err := fts.BatchIndex(batchItems); err != nil {
|
if err := fts.Index(batchItems...); err != nil {
|
||||||
t.Fatalf("failed to batch insert elements: %v", err)
|
t.Fatalf("failed to batch insert elements: %v", err)
|
||||||
}
|
}
|
||||||
return eventIDs, roomIDs
|
return eventIDs, roomIDs
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue