@@ -5,7 +5,6 @@ package elasticsearch
55
66import (
77 "context"
8- "fmt"
98 "strconv"
109 "strings"
1110
@@ -96,7 +95,7 @@ func (b *Indexer) Index(ctx context.Context, issues ...*internal.IndexerData) er
9695 issue := issues [0 ]
9796 _ , err := b .inner .Client .Index ().
9897 Index (b .inner .VersionedIndexName ()).
99- Id (fmt . Sprintf ( "%d" , issue .ID )).
98+ Id (strconv . FormatInt ( issue .ID , 10 )).
10099 BodyJson (issue ).
101100 Do (ctx )
102101 return err
@@ -107,7 +106,7 @@ func (b *Indexer) Index(ctx context.Context, issues ...*internal.IndexerData) er
107106 reqs = append (reqs ,
108107 elastic .NewBulkIndexRequest ().
109108 Index (b .inner .VersionedIndexName ()).
110- Id (fmt . Sprintf ( "%d" , issue .ID )).
109+ Id (strconv . FormatInt ( issue .ID , 10 )).
111110 Doc (issue ),
112111 )
113112 }
@@ -126,7 +125,7 @@ func (b *Indexer) Delete(ctx context.Context, ids ...int64) error {
126125 } else if len (ids ) == 1 {
127126 _ , err := b .inner .Client .Delete ().
128127 Index (b .inner .VersionedIndexName ()).
129- Id (fmt . Sprintf ( "%d" , ids [0 ])).
128+ Id (strconv . FormatInt ( ids [0 ], 10 )).
130129 Do (ctx )
131130 return err
132131 }
@@ -136,7 +135,7 @@ func (b *Indexer) Delete(ctx context.Context, ids ...int64) error {
136135 reqs = append (reqs ,
137136 elastic .NewBulkDeleteRequest ().
138137 Index (b .inner .VersionedIndexName ()).
139- Id (fmt . Sprintf ( "%d" , id )),
138+ Id (strconv . FormatInt ( id , 10 )),
140139 )
141140 }
142141
0 commit comments