@@ -78,7 +78,7 @@ private ElasticLowLevelClient CreateNewElasticLowLevelClient(Uri elasticSearchEn
78
78
var singleNode = new SingleNodeConnectionPool ( _optionsMonitor . CurrentValue . ElasticsearchEndpoint ) ;
79
79
80
80
var cc = new ConnectionConfiguration ( singleNode , new ElasticsearchJsonNetSerializer ( ) )
81
- // .ServerCertificateValidationCallback((obj, cert, chain, policyerrors) => true)
81
+ . ServerCertificateValidationCallback ( ( obj , cert , chain , policyerrors ) => true )
82
82
. EnableHttpPipelining ( )
83
83
. EnableHttpCompression ( )
84
84
. ThrowExceptions ( ) ;
@@ -88,15 +88,15 @@ private ElasticLowLevelClient CreateNewElasticLowLevelClient(Uri elasticSearchEn
88
88
89
89
private void Initialize ( )
90
90
{
91
- //setup a flag in config to chose
91
+ //TODO: setup a flag in config to chose
92
92
//SetupObserver();
93
93
SetupObserverBatchy ( ) ;
94
94
}
95
95
96
96
97
97
private void SetupObserver ( )
98
98
{
99
- _scribeProcessor = a => WriteDirectlyToES ( a ) ;
99
+ _scribeProcessor = async ( a ) => await WriteDirectlyToES ( a ) ;
100
100
101
101
//this._queueToBePosted.GetConsumingEnumerable()
102
102
//.ToObservable(Scheduler.Default)
@@ -128,6 +128,9 @@ private async Task WriteDirectlyToES(JObject jo)
128
128
}
129
129
}
130
130
131
+ //POST /_bulk? filter_path = items.*.error
132
+ private static Dictionary < string , object > filter_path = new Dictionary < string , object > ( ) { { "filter_path" , "items.*.error" } } ;
133
+
131
134
private async Task WriteDirectlyToESAsBatch ( IEnumerable < JObject > jos )
132
135
{
133
136
if ( ! jos . Any ( ) )
@@ -141,7 +144,7 @@ private async Task WriteDirectlyToESAsBatch(IEnumerable<JObject> jos)
141
144
142
145
_ = Client . BulkPutAsync < VoidResponse > ( Index , DocumentType ,
143
146
PostData . MultiJson ( bbo . ToArray ( ) ) ,
144
- new BulkRequestParameters { Refresh = Refresh . False } )
147
+ new BulkRequestParameters { Refresh = Refresh . False , QueryString = filter_path } )
145
148
. ContinueWith ( x =>
146
149
{
147
150
if ( x . IsFaulted )
0 commit comments