1. 程式人生 > 資訊 >順豐公開“物品違規拋扔檢測”相關專利,可通過監控視訊判斷你的快遞是否被“虐待”

順豐公開“物品違規拋扔檢測”相關專利,可通過監控視訊判斷你的快遞是否被“虐待”

安裝:

docker run --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms64m -Xmx512m" -v /mydata/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml -v /mydata/elasticsearch/data:/usr/share/elasticsearch/data -v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins -d elasticsearch:7.4.2
修改資料夾訪問許可權:
chmod -R 777 /mydata/elasticsearch/

安裝:

docker run --name kibana -e ELASTICSEARCH_HOSTS=http://192.168.56.10:9200 -p 5601:5601 -d kibana:7.4.2

設定開機自啟動:
docker update ece --restart=always
docker update cd8 --restart=always

配置遠端擴充套件字典:

[root@loaclhost mydata]# ls
elasticsearch  mysql  nginx  redis
[root@loaclhost mydata]# cd elasticsearch/
[root@loaclhost elasticsearch]# ls
config  data  plugins
[root@loaclhost elasticsearch]# cd plugins/
[root@loaclhost plugins]# ls
ik
[root@loaclhost plugins]# cd ik
[root@loaclhost ik]# ls
commons-codec-1.9.jar  commons-logging-1.2.jar  config  elasticsearch-analysis-ik-7.4.2.jar  httpclient-4.5.2.jar  httpcore-4.4.4.jar  plugin-descriptor.properties  plugin-security.policy
[root@loaclhost ik]# cd config/
[root@loaclhost config]# ls
extra_main.dic         extra_single_word_full.dic      extra_stopword.dic  main.dic         quantifier.dic  suffix.dic
extra_single_word.dic  extra_single_word_low_freq.dic  IKAnalyzer.cfg.xml  preposition.dic  stopword.dic    surname.dic
[root@loaclhost config]# cat IKAnalyzer.cfg.xml 
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <comment>IK Analyzer 擴充套件配置</comment> <!--使用者可以在這裡配置自己的擴充套件字典 --> <entry key="ext_dict"></entry> <!--使用者可以在這裡配置自己的擴充套件停止詞字典
--> <entry key="ext_stopwords"></entry> <!--使用者可以在這裡配置遠端擴充套件字典 --> <entry key="remote_ext_dict">http://192.168.56.10/es/fenci.txt</entry> <!--使用者可以在這裡配置遠端擴充套件停止詞字典--> <!-- <entry key="remote_ext_stopwords">words_location</entry> --> </properties> [root@loaclhost config]#

es目錄:

t/mydata/nginx/html/es

新增客戶端:<dependency>

    <groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>7.4.2</version>
</dependency>


配置檔案:
@Configuration
public class GulimallElasticSearchConfig {

// 單例的
public static final RequestOptions COMMON_OPTIONS;
static {
RequestOptions.Builder builder = RequestOptions.DEFAULT.toBuilder();
// builder.addHeader("Authorization", "Bearer " + TOKEN);
// builder.setHttpAsyncResponseConsumerFactory(
// new HttpAsyncResponseConsumerFactory
// .HeapBufferedResponseConsumerFactory(30 * 1024 * 1024 * 1024));
COMMON_OPTIONS = builder.build();
}

@Bean
public RestHighLevelClient restHighLevelClient() {
RestHighLevelClient client = new RestHighLevelClient(RestClient.builder(new HttpHost("192.168.56.10", 9200, "http")));
return client;
}
}
構建檢索請求:
1.構建bool - query
2.排序,分頁,高亮
3.聚合(類似於sql中的group by)
客戶端執行檢索