use of org.frameworkset.elasticsearch.handler.ESMapResponseHandler in project bboss-elastic by bbossgroups.
the class ESTest method testConfig.
@Test
public void testConfig() throws ParseException {
ClientInterface clientUtil = ElasticSearchHelper.getConfigRestClientUtil("estrace/ESTracesMapper.xml");
TraceExtraCriteria traceExtraCriteria = new TraceExtraCriteria();
traceExtraCriteria.setApplication("testweb1");
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
traceExtraCriteria.setStartTime(dateFormat.parse("2017-09-02 00:00:00").getTime());
traceExtraCriteria.setEndTime(dateFormat.parse("2017-09-10 00:00:00").getTime());
String data = clientUtil.executeRequest("trace-*/_search", "queryPeriodsTopN", traceExtraCriteria, new ESStringResponseHandler());
System.out.println("------------------------------");
System.out.println(data);
System.out.println("------------------------------");
Map<String, Object> response = clientUtil.executeRequest("trace-*/_search", "queryPeriodsTopN", traceExtraCriteria, new ESMapResponseHandler());
if (response.containsKey("error")) {
return;
}
}
use of org.frameworkset.elasticsearch.handler.ESMapResponseHandler in project bboss-elastic by bbossgroups.
the class ESTest method testSearh.
@Test
public void testSearh() throws ParseException {
ClientInterface clientUtil = ElasticSearchHelper.getConfigRestClientUtil("org/frameworkset/elasticsearch/ESTracesMapper.xml");
TraceExtraCriteria traceExtraCriteria = new TraceExtraCriteria();
traceExtraCriteria.setApplication("testweb1");
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
traceExtraCriteria.setStartTime(dateFormat.parse("2017-09-02 00:00:00").getTime());
traceExtraCriteria.setEndTime(dateFormat.parse("2017-09-10 00:00:00").getTime());
String data = clientUtil.executeRequest("trace-*/_search", "queryPeriodsTopN", traceExtraCriteria, new ESStringResponseHandler());
System.out.println("------------------------------");
System.out.println(data);
System.out.println("------------------------------");
Map<String, Object> response = clientUtil.executeRequest("trace-*/_search", "queryPeriodsTopN", traceExtraCriteria, new ESMapResponseHandler());
if (response.containsKey("error")) {
return;
}
}
use of org.frameworkset.elasticsearch.handler.ESMapResponseHandler in project bboss-elastic by bbossgroups.
the class ESTest method testSearhHits.
@Test
public void testSearhHits() throws ParseException {
ClientInterface clientUtil = ElasticSearchHelper.getConfigRestClientUtil("org/frameworkset/elasticsearch/ESTracesMapper.xml");
TraceExtraCriteria traceExtraCriteria = new TraceExtraCriteria();
traceExtraCriteria.setApplication("testweb1");
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
traceExtraCriteria.setStartTime(dateFormat.parse("2017-09-02 00:00:00").getTime());
traceExtraCriteria.setEndTime(dateFormat.parse("2017-09-10 00:00:00").getTime());
String data = clientUtil.executeRequest("trace-*/_search", "queryPeriodsTopN", traceExtraCriteria, new ESStringResponseHandler());
System.out.println("------------------------------");
System.out.println(data);
System.out.println("------------------------------");
Map<String, Object> response = clientUtil.executeRequest("trace-*/_search", "queryPeriodsTopN", traceExtraCriteria, new ESMapResponseHandler());
if (response.containsKey("error")) {
return;
}
}
Aggregations