Remove unneeded method

This commit is contained in:
Till Faelligen 2022-06-13 20:05:35 +02:00
parent 7b5baa6da8
commit 36f0034263
2 changed files with 3 additions and 8 deletions

View file

@ -67,13 +67,8 @@ func (f *Search) Close() error {
return f.FulltextIndex.Close()
}
// FulltextIndex indexes a given element
func (f *Search) Index(e IndexElement) error {
return f.FulltextIndex.Index(e.EventID, e)
}
// BatchIndex indexes the given elements
func (f *Search) BatchIndex(elements []IndexElement) error {
// Index indexes the given elements
func (f *Search) Index(elements ...IndexElement) error {
batch := f.FulltextIndex.NewBatch()
for _, element := range elements {

View file

@ -81,7 +81,7 @@ func mustAddTestData(t *testing.T, fts *fulltext.Search, firstStreamPos int64) (
}
e.SetContentType(gomatrixserverlib.MRoomTopic)
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)
}
return eventIDs, roomIDs