Remove document id
This commit is contained in:
parent
0962e73e3e
commit
a685ccc955
@ -14,10 +14,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ElasticSearch_INDEX = "lotus2"
|
ElasticSearch_INDEX = "lotus-pubsub"
|
||||||
|
|
||||||
ElasticSearch_DOC_LOTUS = "doc_lotus"
|
|
||||||
ElasticSearch_DOC_PUBSUB = "doc_pubsub"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewElasticSearchTransport(connectionString string) (TracerTransport, error) {
|
func NewElasticSearchTransport(connectionString string) (TracerTransport, error) {
|
||||||
@ -55,13 +52,11 @@ type elasticSearchTransport struct {
|
|||||||
|
|
||||||
func (est *elasticSearchTransport) Transport(evt TracerTransportEvent) error {
|
func (est *elasticSearchTransport) Transport(evt TracerTransportEvent) error {
|
||||||
var e interface{}
|
var e interface{}
|
||||||
var docId string
|
|
||||||
if evt.lotusTraceEvent != nil {
|
if evt.lotusTraceEvent != nil {
|
||||||
e = *evt.lotusTraceEvent
|
e = *evt.lotusTraceEvent
|
||||||
docId = ElasticSearch_DOC_PUBSUB
|
|
||||||
} else if evt.pubsubTraceEvent != nil {
|
} else if evt.pubsubTraceEvent != nil {
|
||||||
e = *evt.pubsubTraceEvent
|
e = *evt.pubsubTraceEvent
|
||||||
docId = ElasticSearch_DOC_PUBSUB
|
|
||||||
} else {
|
} else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -72,10 +67,9 @@ func (est *elasticSearchTransport) Transport(evt TracerTransportEvent) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
req := esapi.IndexRequest{
|
req := esapi.IndexRequest{
|
||||||
Index: ElasticSearch_INDEX,
|
Index: ElasticSearch_INDEX,
|
||||||
DocumentID: docId,
|
Body: strings.NewReader(string(jsonEvt)),
|
||||||
Body: strings.NewReader(string(jsonEvt)),
|
Refresh: "true",
|
||||||
Refresh: "true",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perform the request with the client.
|
// Perform the request with the client.
|
||||||
|
Loading…
Reference in New Issue
Block a user