Package org.springframework.data.elasticsearch.core.facet

Examples of org.springframework.data.elasticsearch.core.facet.LogEntityBuilder


    template.deleteIndex(LogEntity.class);
    template.createIndex(LogEntity.class);
    template.putMapping(LogEntity.class);

    SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
    IndexQuery indexQuery1 = new LogEntityBuilder("1").action("update").date(dateFormatter.parse("2013-10-18 18:01")).code(2)
        .ip("10.10.10.1").buildIndex();

    IndexQuery indexQuery2 = new LogEntityBuilder("2").action("update").date(dateFormatter.parse("2013-10-19 18:02")).code(2)
        .ip("10.10.10.2").buildIndex();

    IndexQuery indexQuery3 = new LogEntityBuilder("3").action("update").date(dateFormatter.parse("2013-10-19 18:03")).code(2)
        .ip("10.10.10.3").buildIndex();

    IndexQuery indexQuery4 = new LogEntityBuilder("4").action("update").date(dateFormatter.parse("2013-10-19 18:04")).code(2)
        .ip("10.10.10.4").buildIndex();

    template.bulkIndex(Arrays.asList(indexQuery1, indexQuery2, indexQuery3, indexQuery4));
    template.refresh(LogEntity.class, true);
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.elasticsearch.core.facet.LogEntityBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.