2626 * @source_2: https://github.com/zumo64/ELK_POC
2727 */
2828public class ElasticsearchBackend extends AbstractBackendListenerClient {
29- private static final String ES_PROTOCOL = "es.protocol" ;
3029 private static final String ES_HOST = "es.host" ;
3130 private static final String ES_PORT = "es.transport.port" ;
3231 private static final String ES_INDEX = "es.index" ;
33- private static final String ES_INDEX_TYPE = "es.indexType" ;
3432 private static final String ES_TIMESTAMP = "es.timestamp" ;
3533 private static final String ES_STATUS_CODE = "es.status.code" ;
3634 private static final String ES_CLUSTER = "es.cluster" ;
@@ -39,7 +37,6 @@ public class ElasticsearchBackend extends AbstractBackendListenerClient {
3937 private Client client ;
4038 private Settings settings ;
4139 private String index ;
42- private String indexType ;
4340 private String host ;
4441 private int port ;
4542 private int buildNumber ;
@@ -49,11 +46,9 @@ public class ElasticsearchBackend extends AbstractBackendListenerClient {
4946 @ Override
5047 public Arguments getDefaultParameters () {
5148 Arguments parameters = new Arguments ();
52- parameters .addArgument (ES_PROTOCOL , "https" );
5349 parameters .addArgument (ES_HOST , null );
5450 parameters .addArgument (ES_PORT , "9300" );
5551 parameters .addArgument (ES_INDEX , null );
56- parameters .addArgument (ES_INDEX_TYPE , "SampleResult" );
5752 parameters .addArgument (ES_TIMESTAMP , "yyyy-MM-dd'T'HH:mm:ss.SSSZZ" );
5853 parameters .addArgument (ES_STATUS_CODE , "531" );
5954 parameters .addArgument (ES_CLUSTER , "elasticsearch" );
@@ -65,7 +60,6 @@ public Arguments getDefaultParameters() {
6560 public void setupTest (BackendListenerContext context ) throws Exception {
6661 try {
6762 this .index = context .getParameter (ES_INDEX );
68- this .indexType = context .getParameter (ES_INDEX_TYPE );
6963 this .host = context .getParameter (ES_HOST );
7064 this .bulkSize = Integer .parseInt (context .getParameter (ES_BULK_SIZE ));
7165 this .port = Integer .parseInt (context .getParameter (ES_PORT ));
@@ -82,7 +76,7 @@ public void setupTest(BackendListenerContext context) throws Exception {
8276 @ Override
8377 public void handleSampleResults (List <SampleResult > results , BackendListenerContext context ) {
8478 for (SampleResult sr : results ) {
85- this .bulkRequest .add (this .client .prepareIndex (this .index , this . indexType ).setSource (this .getElasticData (sr , context ), XContentType .JSON ));
79+ this .bulkRequest .add (this .client .prepareIndex (this .index , "SampleResult" ).setSource (this .getElasticData (sr , context ), XContentType .JSON ));
8680 }
8781
8882 if (this .bulkRequest .numberOfActions () >= this .bulkSize ) {
0 commit comments