The pre-lending system is responsible for the implementation of all business processes from receipt to pre-lending, which involves some comprehensive queries with large amount of data, diverse conditions and complex conditions. The introduction of ElasticSearch is mainly to improve the query efficiency, and hopes to quickly implement a simple data warehouse based on ElasticSearch and ..
Category : elasticsearch
Docker build series Building zk Cluster in docker Environment Docker Builds redis Cluster Docker environment builds elasticsearch Docker Builds rabbitmq Cluster Docker Environment Builds ELK Order This article focuses on how to use docker to build elasticsearch. Download image Use herehangxin1940The mirror image is only version 1.4.2 of es. docker pull hangxin1940/docker-elasticsearch-cn:v1.6.0 Start container docker ..
SpringBoot application series articles Configuration center for SpringBoot applications Distributed session for SpringBoot application Distributed index for SpringBoot applications Distributed caching for SpringBoot applications Message queue for SpringBoot application ELK for SpringBoot application Order This article focuses on how to use elasticsearch in SpringBoot. Elasticsearch is an index service from its root, but at the ..
SpringBoot application series articles Configuration center for SpringBoot applications Distributed session for SpringBoot application Distributed index for SpringBoot applications Distributed caching for SpringBoot applications Message queue for SpringBoot application ELK for SpringBoot application Order This article mainly talks about how to configure output to logstash in SpringBoot and use elk technology stack to view logs ..
Order Before springboot 1.4, if Spring Data Elasticity Search version 2.x is used, the boot will report an error, because es relied on before springboot1.4 is version 1.x. Es2.x cannot be used until version 1.4 is released. Upgrade to springboot1.4 parent <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.0.M3</version> <relativePath/> <!– lookup parent from repository –> </parent> Non-release Edition ..
Introducing spring-data-elasticsearch <!– http://mvnrepository.com/artifact/org.springframework.data/spring-data-elasticsearch –> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-elasticsearch</artifactId> <version>2.0.1.RELEASE</version> </dependency> Custom event flusher public class EsEventFlusher extends AbstractEventFlusher { private static final Logger logger = LoggerFactory.getLogger(EsEventFlusher.class); @Override public void closing(CommandContext commandContext) { for (EventLoggerEventHandler eventHandler : eventHandlers) { try { EventLogEntryEntity entryEntity = eventHandler.generateEventLogEntry(commandContext); EventLogEs es = EventLogEs.buildFrom(entryEntity); EventLogEsRepository repository = ApplicationContextHolder.getContext().getBean(EventLogEsRepository.class); repository.save(es); logger.info(“###{}”,es); repository.refresh(); ..
Installation ./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.2.0/elasticsearch-sql-2.3.2.0.zip docker docker run -it -p 9200:9200 -p 9300:9300 elasticsearch:2.3.2 Address http://192.168.99.100:9200/_plugin/sql/ Interface References elastic..
References https://segmentfault.com/a/1190000004428116 query_string { “query”: { “query_string”: { “query”:”globalVar”, “fields”:[“dataJson”], “use_dis_max”:true } }, “sort”: [ { “timeStamp”: { “order”: “desc” } } ] } Fuzzy Search for Variables posthttp://192.168.99.100:9200/event_log/_search { “query”: { “fuzzy”: { “dataJson”: “golbalVar” } }, “sort”: [ { “timeStamp”: { “order”: “des..
Only hq was installed, but js reported an error, which was not modified at that time. Today, a repair plan was found, as follows: Installation bin/plugin install royrusso/elasticsearch-HQ Modify js cd /usr/share/elasticsearch/plugins/hq/_site vim js/lib/jquery/jquery.tablesorter.js :908 ##注释掉这行return $.tablesorter.formatFloat(s.replace(new RegExp(/[£$€]/g), “”)); vim index.html :213 ##去掉min,为<script src=”js/lib/jquery/jquery.tablesorter.js”></script> Connection References [elastic search] construction of elastic search 2.x environment and ..
log4j2elastic <!– https://mvnrepository.com/artifact/net.inemar.utility/log4j2elastic –> <dependency> <groupId>net.inemar.utility</groupId> <artifactId>log4j2elastic</artifactId> <version>3.1.0</version> </dependency> Log4j2 configuration <?xml version=”1.0″ encoding=”UTF-8″?> <Configuration status=”warn” name=”MyApp” packages=””> <Appenders> <Console name=”Console” target=”SYSTEM_OUT” ignoreExceptions=”false”> <PatternLayout pattern=”%d{yyyy-MM-dd HH:mm:ss} [%t] (%F:%L) – %m%n” /> </Console> <ElasticAppender name=”ElasticAppender” manager=”true”/> </Appenders> <Loggers> <Root level=”info”> <AppenderRef ref=”Console” /> <AppenderRef ref=”ElasticAppender” level=”error” /> </Root> </Loggers> </Configuration> Configure environment variables elastic_local = native://192.168.99.100:9300 ..
Run-time setting index Configuration file es.index.name=demo Configure bean @Value(“${es.index.name}”) String indexName; @Bean public String indexName(){ return indexName; } Configure domain @Document(indexName=”#{@indexName}”, type = “log”) dao public interface DemoDao extends ElasticsearchRepository<Demo,String>{ Page<Demo> findByApp(String app, Pageable pageable); } The advantage is that the runtime can specify, but cannot dynamically query different index’s dynamic parameter @Autowired ElasticsearchTemplate elasticsearchTemplate; ..
Query and filter merge Queries and filters merged List filter’s api as deprecated and merge it into query. After that, the context of the query is divided into the context of the query and the context of the filter. If the context is not a filter, go to query’s context. Filter, the results will not ..