@@ -26,7 +26,7 @@ import (
26
26
27
27
const (
28
28
// Version is the current version of Elastic.
29
- Version = "7.0.6 "
29
+ Version = "7.0.7 "
30
30
31
31
// DefaultURL is the default endpoint of Elasticsearch on the local machine.
32
32
// It is used e.g. when initializing a new Client without a specific URL.
97
97
98
98
// noRetries is a retrier that does not retry.
99
99
noRetries = NewStopRetrier ()
100
+
101
+ // noDeprecationLog is a no-op for logging deprecations.
102
+ noDeprecationLog = func (* http.Request , * http.Response ) {}
100
103
)
101
104
102
105
// Doer is an interface to perform HTTP requests.
@@ -117,12 +120,13 @@ type Client struct {
117
120
conns []* conn // all connections
118
121
cindex int // index into conns
119
122
120
- mu sync.RWMutex // guards the next block
121
- urls []string // set of URLs passed initially to the client
122
- running bool // true if the client's background processes are running
123
- errorlog Logger // error log for critical messages
124
- infolog Logger // information log for e.g. response times
125
- tracelog Logger // trace log for debugging
123
+ mu sync.RWMutex // guards the next block
124
+ urls []string // set of URLs passed initially to the client
125
+ running bool // true if the client's background processes are running
126
+ errorlog Logger // error log for critical messages
127
+ infolog Logger // information log for e.g. response times
128
+ tracelog Logger // trace log for debugging
129
+ deprecationlog func (* http.Request , * http.Response )
126
130
scheme string // http or https
127
131
healthcheckEnabled bool // healthchecks enabled or disabled
128
132
healthcheckTimeoutStartup time.Duration // time the healthcheck waits for a response from Elasticsearch on startup
@@ -245,6 +249,7 @@ func NewSimpleClient(options ...ClientOptionFunc) (*Client, error) {
245
249
sendGetBodyAs : DefaultSendGetBodyAs ,
246
250
gzipEnabled : DefaultGzipEnabled ,
247
251
retrier : noRetries , // no retries by default
252
+ deprecationlog : noDeprecationLog ,
248
253
}
249
254
250
255
// Run the options on it
@@ -330,6 +335,7 @@ func DialContext(ctx context.Context, options ...ClientOptionFunc) (*Client, err
330
335
sendGetBodyAs : DefaultSendGetBodyAs ,
331
336
gzipEnabled : DefaultGzipEnabled ,
332
337
retrier : noRetries , // no retries by default
338
+ deprecationlog : noDeprecationLog ,
333
339
}
334
340
335
341
// Run the options on it
@@ -1386,7 +1392,7 @@ func (c *Client) PerformRequest(ctx context.Context, opt PerformRequestOptions)
1386
1392
1387
1393
// Log deprecation warnings as errors
1388
1394
if len (res .Header ["Warning" ]) > 0 {
1389
- logDeprecation ((* http .Request )(req ), res )
1395
+ c . deprecationlog ((* http .Request )(req ), res )
1390
1396
for _ , warning := range res .Header ["Warning" ] {
1391
1397
c .errorf ("Deprecation warning: %s" , warning )
1392
1398
}
@@ -1483,9 +1489,9 @@ func (c *Client) Reindex() *ReindexService {
1483
1489
1484
1490
// TermVectors returns information and statistics on terms in the fields
1485
1491
// of a particular document.
1486
- func (c * Client ) TermVectors (index , typ string ) * TermvectorsService {
1492
+ func (c * Client ) TermVectors (index string ) * TermvectorsService {
1487
1493
builder := NewTermvectorsService (c )
1488
- builder = builder .Index (index ). Type ( typ )
1494
+ builder = builder .Index (index )
1489
1495
return builder
1490
1496
}
1491
1497
0 commit comments