文档章节

总结:ElasticSearch查询

浮躁的码农
 浮躁的码农
发布于 10/23 15:50
字数 3507
阅读 17
收藏 0

环境:ES2.3.2     

地址:xxx:9200

注意动词使用:GET,POST,PUT,DELETE

 

ElasticSearch  PK  Mysql

我的告警页面,查询条件会status='OK',isalarm=1,时间范围在:2019-03-01 13:45:41   到    2019-03-07 13:47:37的告警消息

Mysql:

select mca.endpoint_counter,mca.host_uuid,mca.host_status,mca.type,mca.pid,mca.id as id,businessid as grp,businessid as grp_en_name, eventid as eventid, endpoint as endpoint,node as node,triggername as triggername ,itemid as metric ,leveles as alertlevel ,itemvalue as leftvalue ,alertstatus,fuxi_status,round(case when enddate is null then ((UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(begindate))/60 ) else ((UNIX_TIMESTAMP(enddate) - UNIX_TIMESTAMP(begindate))/60 ) end,2) as duration,handlestatus as handlestatus,handleprocess as handleprocess,handlemessage as handlemessage,mca.createdate as createdate,mca.modifydate as modifydate,begindate as eventTime,enddate as enddate,defaultType as defaultType,userId as userId,strategy as strategy,pushedtags as pushedtags,tu.username,mca.isalarm,source,idc,mca.is_process_timeout as isTimeout 
from mc_alerts mca LEFT JOIN t_users tu on tu.id = mca.userid join grp g on mca.businessid=g.grp_en_name 
where mca.begindate >= '2019-03-01 13:45:41' and mca.begindate <= '2019-03-07 13:47:37' and mca.alertstatus ='OK' 
and mca.isalarm  = 1   and find_in_set('weiwei',g.contacts)

查询时间约;10秒

 

http://xxx:9200/hubble-alarm-mysqlio/mc_alerts/_search?pretty

ElasticSearch:

{
	"profile":false,
	"from" : 0, "size" : 50,
    "query": {
    	"bool": {
            "must": [
            	{"range":{"eventTime":{"gte":1551419141000,"lte":1551937657000}}},
            	{"term":{"status":"ok"}},
            	{"term":{"isalarm":"1"}},
            	{"terms": {
		            "grp": ["monitor","hubble_dialtest","sh-ops","mesos","personal-weiwei","Qiyi-Cloud-Monitor","hubble","sysnet-qim-test","qim_test_","idrac","idrac_cangnan_ct","idrac_jiujiang_ct","idrac_jilin_crtc","idrac_shijiazhuang_cnc","idrac_zhanjiang_ct","idrac_shijiazhuang2_cnc","idrac_foshan_ct","idrac_beijing2_ct","idrac_qingdao_cnc","idrac_zibo2_cnc","idrac_shanghai_crtc","idrac_sichuan_cmnet","idrac_tianjin_scc","idrac_wuxi_ct","idrac_shanghai_colnet","idrac_heilongjiang_cmnet","idrac_handan_cnc","idrac_jiangsu_cmnet","idrac_jiangsu_crtc","idrac_beijing4_dxt","idrac_beijing_dxt","idrac_xinjiang_cmnet","idrac_shan3xi_cmnet","idrac_zhanjiang2_ct","idrac_liaoning_crtc","idrac_zhejiang_cmnet","idrac_hangzhou2_cnc","idrac_shan1xi_cmnet","idrac_zhejiang_crtc","idrac_hubei_crtc","idrac_guangdong_crtc","idrac_sichuan_crtc","idrac_beijing_crtc","idrac_yunnan_aipu","idrac_guangzhou_gwbn","idrac_anhui_cmnet","idrac_shan3xi_crtc","idrac_handan2_cnc","idrac_changshu_ct","idrac_taicang_ct","idrac_wujiang_ct","idrac_fujian_crtc","idrac_hunan_crtc","idrac_jinan_ct","idrac_chongqing_aipu","idrac_qingdao_cmnet","idrac_shenyang_gwbn","idrac_jilin_cnc","idrac_shenzhen_twnet","idrac_shandong_crtc","idrac_jiamusi_cnc","idrac_heilongjiang_crtc","idrac_beijing_bgctvnet","idrac_jiangsu_scc","idrac_jilin2_cnc","idrac_hengyang_ct","idrac_ningbo2_ct","idrac_hebei_crtc","idrac_wuhan2_gwbn","idrac_henan_crtc","idrac_beijing_office","idrac_fujian_cfic","idrac_jinan2_cnc","idrac_jiangxi_crtc","idrac_beijing4_ct","idrac_hunan_citic","idrac_shan3xi_scc","idrac_jinan_cmnet","idrac_shenzhen_gwbn","idrac_hunan_scc","idrac_qingdao_scc","idrac_beijing2_crtc","idrac_chongqing_ct","idrac_shanghai6_ct","idrac_jiyang_cnc","idrac_nanning_crtc","idrac_zibo_cnc","idrac_beijing3_crtc","idrac_liaoning_cmnet","idrac_changchun_fbwn","idrac_chongqing_gwbn","idrac_beijing2_cnc","idrac_xian_gwbn","idrac_kunming_ct","idrac_quanzhou_cnc","idrac_foshan2_ct","idrac_beijing_21vianet","idrac_suzhou_cnc","idrac_jinan4_cnc","idrac_zhejiang3_cmnet","idrac_beijing_cnc","idrac_guangzhou_crtc","idrac_sichuan_gwbn","idrac_dongguan4_ct","idrac_jilin_cmnet","idrac_jining_cnc","idrac_dongguan5_ct","idrac_shijiazhuang3_cnc","idrac_wuxi2_ct","idrac_anhui2_cmnet","idrac_dongguan7_ct","idrac_tianjin_gwbn","idrac_beijing2_ispun","idrac_jinan2_cmnet","idrac_shijiazhuang_gwbn","idrac_xiamen_gwbn","idrac_nanjing_cmnet","idrac_kunming_gwbn","idrac_hangzhou_gwbn","idrac_changsha_gwbn","idrac_dalian_fbwn","idrac_nanning_gwbn","idrac_yichang_gwbn","idrac_haerbin_gwbn","idrac_changsha_cscatv","idrac_nanjing_gwbn","idrac_chongqing2_ct","idrac_nanchang_gwbn","idrac_suzhou_gwbn","idrac_changchun_gwbn","idrac_taiyuan_gwbn","idrac_jinan_gwbn","idrac_fuzhou_gwbn","idrac_dongguan_gwbn","idrac_beijing3_fbwn","idrac_wuhan3_gwbn","idrac_wuhan_scc","idrac_shantou_gwbn","idrac_guiyang_gwbn","idrac_jiyang_cmnet","idrac_hangzhou3_wasu","idrac_taicang2_ct","idrac_beijing6_dxt","idrac_shenzhen_cmnet","idrac_pps_shanghai_office","idrac_beijing_citic","idrac_quanzhou3_cnc","idrac_beijing2_21vianet","idrac_shenyang4_cnc","idrac_foshan6_ct","idrac_jinan5_cnc","idrac_losangeles_dxt","idrac_shenyang5_cnc","idrac_chongqing3_ct","idrac_shanghai12_ct","idrac_shanghai3_crtc","idrac_taibei_office","idrac_beijing_cmnet","idrac_wuhan4_gwbn","idrac_taiyuan2_cmnet","idrac_shanghai3_gwbn","idrac_tianjin4_cnc","idrac_beijing10_ct","idrac_zibo5_cnc","idrac_shenyang2_gwbn","idrac_shenzhen2_gwbn","idrac_fuzhou_scc","idrac_chongqing4_ct","idrac_hefei_cmnet","idrac_taibei_other","idrac_beijing7_ct","idrac_haerbin2_cnc","idrac_jinan7_cnc","idrac_chengdu_gwbn","idrac_changchun_crtc","idrac_tianjin3_gwbn","idrac_shenyang_fengantongwei","idrac_haidong_cmnet","idrac_zhejiang6_cmnet","idrac_taian2_scc","idrac_chongqing2_scc","idrac_nanchang5_ct","idrac_shanghai6_gwbn","idrac_hefei2_scc","idrac_beijing5_cnc","idrac_chongqing_office","idrac_haerbin_cnc","idrac_dalian_gwbn","idrac_chongqing_cnc","idrac_ganzhou_ct","idrac_beijing2_office","idrac_wuhan_cernet","idrac_beijing3_dxt","idrac_guangzhou_ehome","idrac_longsheng_storeroom","idrac_chongqing3_cnc","idrac_hangzhou_wasu","idrac_baidu_jinan_cnc","idrac_shenzhen_fengantongwei","idrac_foshan_fengantongwei","idrac_yichun_fengantongwei","idrac_zhengzhou_fengantongwei","idrac_xianyang_fengantongwei","idrac_guangzhou_fengantongwei","idrac_nanning_fengantongwei","idrac_hefei_fengantongwei","idrac_nanjing_fengantongwei","idrac_changsha_fengantongwei","idrac_changchun_fengantongwei","idrac_lanzhou_scc","idrac_shijiazhuang_wasu","idrac_shanghai4_gwbn","idrac_shenzhen3_gwbn","idrac_xianyang_scc","idrac_huhehaote_scc","idrac_guiyang_scc","idrac_fuzhou_wasu","idrac_seoul_dxt","idrac_toronto_dxt","idrac_shenzhen_other","idrac_guangzhou_21vianet","idrac_nanchang_scc","idrac_changsha_scc","idrac_jinan_scc","idrac_beijing_baidu","idrac_quanzhou_wasu","idrac_hangzhou7_wasu","idrac_dongguan_scc","idrac_zhengzhou2_scc","idrac_jiangyin2_wasu","idrac_nanning2_wasu","idrac_beijing6_office","idrac_shenyang_crtc","idrac_beijing11_ct","idrac_wuhan_ct","idrac_lanzhou2_ct","idrac_wenzhou_ct","idrac_qingdao_gwbn","idrac_weifang_cnc","idrac_chongqing2_cnc","idrac_kunming2_ct","idrac_hangzhou_cnc","idrac_dalian_cnc","idrac_jinan_cnc","idrac_hongkong_bn","idrac_ningbo6_ct","idrac_yantai_cnc","idrac_zhanjiang5_ct","idrac_loudi_ct","idrac_zhenhai_ct","idrac_dongguan_ct","idrac_jiyang_ct","idrac_dongguan2_ct","idrac_zhaotong_ct","idrac_zhanjiang4_ct","idrac_zhengzhou4_cnc","idrac_beijing5_dxt","idrac_zhejiang2_cmnet","idrac_ningbo3_ct","idrac_dongguan3_ct","idrac_dalian2_cnc","idrac_lanzhou3_ct","idrac_beijing9_dxt","idrac_zibo3_cnc","idrac_nanning_ct","idrac_changshu2_ct","idrac_haikou_ct","idrac_ruian2_ct","idrac_ruian_ct","idrac_xiamen2_ct","idrac_wuxi3_ct","idrac_zhejiang4_cmnet","idrac_xiamen3_ct","idrac_nanning2_ct","idrac_changshu3_ct","idrac_wujiang2_ct","idrac_taiyuan5_cnc","idrac_beijing2_cmnet","idrac_qingdao_ct","idrac_wuxi4_ct","idrac_haikou2_ct","idrac_xiamen_cnc","idrac_yiyang_ct","idrac_zhejiang5_cmnet","idrac_chongqing4_cnc","idrac_jilin_scc","idrac_zhaotong2_ct","idrac_jiangmen_cnc","idrac_cangzhou2_cnc","idrac_qingdao2_ct","idrac_hefei_gwbn","idrac_zhengzhou_gwbn","idrac_lanzhou4_ct","idrac_qingdao4_cnc","idrac_shenzhen_ct","idrac_guangzhou_cmnet","idrac_suzhou2_cnc","idrac_nanning3_ct","idrac_quzhou_ct","idrac_xiamen4_ct","idrac_zibo4_cnc","idrac_zhenjiang2_ct","idrac_nanjing2_cmnet","idrac_nanjing3_cmnet","idrac_wuxi_gwbn","idrac_chengdu_cmnet","idrac_beijing3_21vianet","idrac_zhengzhou5_cnc","idrac_beijing5_ct","idrac_zhanjiang6_ct","idrac_beijing6_ct","idrac_beijing4_office","idrac_hengyang3_ct","idrac_dongguan8_ct","idrac_wuxi5_ct","idrac_beijing7_dxt","idrac_chongqing7_cnc","idrac_nanjing4_cmnet","idrac_jilin3_cnc","idrac_guangzhou2_gwbn","idrac_quanzhou2_cnc","idrac_beijing3_cnc","idrac_beijing4_cnc","idrac_foshan3_ct","idrac_foshan4_ct","idrac_foshan8_ct","idrac_beijing8_dxt","idrac_jinan3_cmnet","idrac_xiamen2_cnc","idrac_shanghai11_ct","idrac_shanghai8_ct","idrac_shanghai10_ct","idrac_beijing3_cmnet","idrac_beijing9_ct","idrac_shaoguan_gwbn","idrac_ningbo_cnc","idrac_nanchang3_ct","idrac_nanchang2_ct","idrac_dalian3_cnc","idrac_wuhan2_ct","idrac_xiamen5_ct","idrac_zhenjiang3_ct","idrac_wuhan4_ct","idrac_kunming3_ct","idrac_yuyao_ct","idrac_beijing5_crtc","idrac_huizhou_cnc","idrac_huizhou3_cnc","idrac_shijiazhuang4_cnc","idrac_hangzhou4_wasu","idrac_nanchang4_ct","idrac_hengyang4_ct","idrac_hangzhou2_cmnet","idrac_hangzhou_cmnet","idrac_foshan5_ct","idrac_lasa_cmnet","idrac_nanning4_ct","idrac_huhehaote_cnc","idrac_jinan4_cmnet","idrac_jiyang2_ct","idrac_beijing4_21vianet","idrac_lanzhou5_ct","idrac_yangzhou_ct","idrac_yangzhou2_ct","idrac_shanghai2_chilian","idrac_shijiazhuang5_cnc","idrac_shaoxing_ct","idrac_shaoxing2_ct","idrac_kunming_cnc","idrac_qingdao3_ct","idrac_zhenjiang4_ct","idrac_wuxi7_ct","idrac_qingdao5_cnc","idrac_wuxi_cmnet","idrac_jinan5_cmnet","idrac_guangzhou2_crtc","idrac_nanjing5_cmnet","idrac_hengyang6_ct","idrac_hangzhou3_cmnet","idrac_qingdao2_cmnet","idrac_chongqing_scc","idrac_taicang3_ct","idrac_changshu4_ct","idrac_wujiang3_ct","idrac_ruian3_ct","idrac_hangzhou5_wasu","idrac_nanning2_crtc","idrac_suqian_ct","idrac_qingdao6_cnc","idrac_luoyang_cnc","idrac_luoyang2_cnc","idrac_kunming4_ct","idrac_foshan7_ct","idrac_shenyang_cmnet","idrac_shenzhen2_ct","idrac_jinan8_cnc","idrac_chengdu2_aipu","idrac_chongqing6_cnc","idrac_jiangmen2_cnc","idrac_lanzhou_cmnet","idrac_chengdu2_cmnet","idrac_handan3_cnc","idrac_xian2_gwbn","idrac_yantai2_cnc","idrac_hengyang7_ct","idrac_binzhou_cnc","idrac_yangzhou3_ct","idrac_qingdao2_gwbn","idrac_wuhan3_ct","idrac_hefei3_cmnet","idrac_hefei2_cmnet","idrac_yangzhou4_ct","idrac_suzhou3_cnc","idrac_lanzhou7_ct","idrac_shenyang6_cnc","idrac_xiamen6_ct","idrac_qingdao4_ct","idrac_wulumuqi_cmnet","idrac_quzhou2_ct","idrac_beijing4_fbwn","idrac_cangzhou3_cnc","idrac_kunming_cmnet","idrac_shanghai4_crtc","idrac_beijing10_dxt","idrac_hangzhou5_cmnet","idrac_xiangyang_cmnet","idrac_xiangyang2_cmnet","idrac_hangzhou4_cmnet","idrac_haerbin_cmnet","idrac_hengyang8_ct","idrac_kunming_fengantongwei","idrac_chongqing2_cmnet","idrac_jinan_fengantongwei","idrac_hangzhou_fengantongwei","idrac_chengdu_fengantongwei","idrac_kunming5_ct","idrac_dongguan10_ct","idrac_guiyang_fengantongwei","idrac_suqian2_ct","idrac_dalian4_cnc","idrac_zhengzhou6_cnc","idrac_beijing2_bgctvnet","idrac_qingdao3_cmnet","idrac_qingdao4_cmnet","idrac_zhaotong3_ct","idrac_hangzhou6_cmnet","idrac_hangzhou7_cmnet","idrac_hangzhou8_cmnet","idrac_xian3_ct","idrac_taiyuan_fengantongwei","idrac_shanghai5_gwbn","idrac_zhengzhou2_cmnet","idrac_huhehaote2_cnc","idrac_beijing2_cernet","idrac_wulumuqi_ct","idrac_chongqing3_cmnet","idrac_yunnan_crtc","idrac_chengdu2_scc","idrac_tianjin_crtc","idrac_wuxi2_cmnet","idrac_tianjin_fengantongwei","idrac_guangzhou2_cmnet","idrac_changsha_cmnet","idrac_xiamen_fengantongwei","idrac_shijiazhuang_crtc","idrac_wuhan5_cnc","idrac_nanjing_cnc","idrac_shijiazhuang6_cnc","idrac_xian4_ct","idrac_taiyuan6_cnc","idrac_jilin4_cnc","idrac_jining3_cnc","idrac_hefei4_cmnet","idrac_zhengzhou3_cmnet","idrac_changchun_iocp","idrac_wuxi3_cmnet","idrac_zhengzhou7_cnc","idrac_zhengzhou8_cnc","idrac_nantong_ct","idrac_taizhou_ct","idrac_taiyuan7_cnc","idrac_zhuzhou_ct","idrac_beijing2_cnix","idrac_shenyang2_cmnet","idrac_tianjin6_cnc","idrac_haikou3_ct","idrac_shijiazhuang7_cnc","idrac_wuxi10_ct","idrac_chongqing5_ct","idrac_ningbo7_ct","idrac_chengdu3_cmnet","idrac_chongqing4_cmnet","idrac_nanchang3_cmnet","idrac_fuzhou2_cfic","idrac_nanjing_iocp","idrac_wuhan_qnet","idrac_suzhou_test","idrac_shanghai_office","idrac_shenyang_cnc","idrac_tianjin2_cnc","idrac_haerbin_fengantongwei","idrac_shanghai_yicheng","idrac_wuhan_fengantongwei","idrac_beijing5_office","idrac_chongqing2_gwbn","idrac_hangzhou6_wasu","idrac_chengdu_scc","idrac_wulumuqi_scc","idrac_hongkong_hkix","idrac_guangzhou2_scc","idrac_hefei_scc","idrac_beijing5_21vianet","idrac_fuzhou_cfic","idrac_losangeles2_dxt","idrac_haerbin_scc","idrac_beijing_qishunix","idrac_jinan_wasu","idrac_huhehaote2_scc","idrac_guangzhou_gzcatv","idrac_shenyang_scc","idrac_hongkong2_equinix","idrac_shanghai_qnet","idrac_macau_ctm","idrac_wuhan2_scc","idrac_yinchuan_scc","jk-vrs","ads-backend_proxy_bjdxt","ads_serving_proxy_zjyd","idrac_shijiazhuang_scc","idrac_xianyang2_scc","idrac_dezhou_scc","idrac_taian_scc","idrac_beijing2_baidu","idrac_nanjing2_iocp","hcdn_uproxy","idrac_lasa_ngaa","ads_online_exchange","idrac_guangzhou_iocp","idrac_shijiazhuang_cmnet","idrac_tianjin2_scc","idrac_zhengzhou4_cmnet","idrac_nanchang_fengantongwei","idrac_wuxi_scc","dxt9/aggregator","beijing_baidu/aggregator","dxt9/hbs","beijing_baidu/hbs","beijing_baidu/transfer","dxt9/transfer","beijing_baidu/judge","dxt9/judge","beijing_baidu/task","dxt9/task","beijing_baidu/query","dxt9/query","beijing_baidu/graph","jiyang/graph","idrac_beijing_zjy","agent_data_delivery_bdyf","idrac_kelamayi_cmnet","idrac_taibei_aptg","idrac_xian2_iocp","idrac_haerbin_iocp","idrac_xian_scc","idrac_changshu_cmnet","idrac_nanjing6_cmnet","idrac_taibei_twm","idrac_taibei_tst","iocp_cache","idrac_hangzhou9_cmnet","idrac_tianjin2_crtc","NODE","personal-renkai-sx","idrac_chengdu_office","idrac_nanning_scc","idrac_beijing_heijing","idrac_guangzhou3_cmnet","idrac_guangzhou4_cmnet","idrac_zhengzhou5_cmnet","idrac_nanjing3_iocp","idrac_guiyang2_scc","idrac_guangzhou2_iocp","idrac_chengdu4_cmnet","idrac_xianyang_cmnet","idrac_shijiazhuang_test","idrac_heze_fengantongwei","idrac_quanzhou_fengantongwei","idrac_linyi_fengantongwei","idrac_dongguan_fengantongwei","idrac_xuzhou_fengantongwei","idrac_ningbo_fengantongwei","idrac_handan_fengantongwei","idrac_shijiazhuang_fengantongwei","idrac_baoding_fengantongwei","idrac_dongguan2_scc","exchange_offline","hwm","idrac_tianjin_iocp","idrac_beijing_iocp","idrac_beijing2_iocp","idrac_chongqing6_cmnet","hubblemanager","hubble-api/portal/nginx","hubble-sdk-api/graph","hubble-alarm","hubble-job","hubble-test","idrac_changchun2_iocp","idrac_xian_iocp","idrac_yangzhou_iocp","idrac_shanghai3_cmnet","idrac_guiyang2_cmnet","idrac_guangzhou3_iocp","cluster_monitor","idrac_shanghai_iocp","idrac_chongqing5_cmnet","idrac_wuhan3_scc","idrac_shanghai2_iocp","idrac_shanghai3_iocp","idrac_yichang_gezhouba","idrac_tianjin2_iocp","idrac_yichang_iocp","idrac_zhengzhou6_cmnet","idrac_kunming2_cmnet","idrac_chengdu2_office","idrac_nanning2_cmnet","     ","renkaitest111","renkaitest2","idrac_changchun_scc","idrac_fuzhou2_wasu","idrac_xiangyang3_cmnet","idrac_hangzhou10_cmnet","idrac_nanchang4_cmnet","idrac_beijing_chinacache","mesos-chronos","idrac_shijiazhuang2_cmnet","idrac_fuzhou_cmnet","idrac_huainan_cmnet","idrac_haerbin2_scc","idrac_beijing_xingchi","idrac_shenzhen2_twnet","idrac_beijing_cnisp","idrac_haerbin_test","idrac_hangzhou8_wasu","idrac_chengdu3_scc","idrac_langfang_ct_test","idrac_tonghua_test","idrac_zhengzhou7_cmnet","qim-test-sub-ww","qim-test-sub-2","weiwei-test-qim3","idrac_nanchang5_cmnet","idrac_wuhan_iocp","idrac_jinan_iocp","idrac_taiyuan8_cnc","idrac_changsha2_scc","idrac_huhehaote_cmnet","idrac_shijiazhuang2_scc","idrac_shijiazhuang3_cmnet","idrac_shenyang3_cmnet","idrac_shanghai2_colnet","idrac_haikou2_cmnet","idrac_guangzhou5_cmnet","idrac_beijing4_iocp","idrac_wuxi2_scc","idrac_shanghai4_iocp","idrac_guangzhou6_cmnet","idrac_guangzhou7_cmnet","idrac_wuhan_lkg","idrac_chongqing3_scc","idrac_shanghai5_iocp","idrac_shanghai10_iocp","idrac_shanghai9_iocp","idrac_lanzhou_cnciptv","idrac_beijing3_baidu","idrac_hangzhou9_wasu","idrac_wuhan_baidu","idrac_shanghai_huanwei","idrac_beijing2_xingchi","Hubble-Transfer-Judge","idrac_qingdao5_cmnet","a/b/c","test_child_group","idrac_shenzhen3_ct","idrac_chongqing_cnciptv","idrac_beijing5_iocp","test-luyafei-04","test2","test22","test-luyafei-05","test-luyafei-06","test-luyafei-07","test-luyafei-08","idrac_zhoukou_fengantongwei","idrac_shangqiu_fengantongwei","idrac_wulumuqi_cnciptv","idrac_jining_fengantongwei","idrac_nanyang_fengantongwei","idrac_langfang_fengantongwei","idrac_cangzhou_fengantongwei","idrac_tangshan_fengantongwei","idrac_xinyang_fengantongwei","idrac_yancheng_fengantongwei","idrac_taizhou_fengantongwei","idrac_jinhua_fengantongwei","idrac_luoyang_fengantongwei","idrac_wuxi_fengantongwei","idrac_xuchang_fengantongwei","idrac_puyang_fengantongwei","idrac_liaocheng_fengantongwei","idrac_jinan_cernet","idrac_fuzhou2_cmnet","idrac_shanghai8_iocp","idrac_shanghai7_iocp","idrac_huanggang_iocp","idrac_shanghai6_iocp","idrac_ningbo_iocp","idrac_beijing6_iocp","idrac_tonghua_cnc","idrac_haerbin3_cnc","idrac_haerbin2_iocp","personal-weiwei-test","idrac_changsha2_cmnet","idrac_shijiazhuang3_scc","idrac_bangkok_ais","idrac_fuzhou_cnciptv","idrac_huhehaote3_scc","idrac_wuhan4_scc","Hubble-Grafana","idrac_quanzhou_scc","hubble-updater-server","idrac_zhengzhou_cnciptv"]
		        }
		    }]
    	}
    }
}

查询时间:184毫秒

 

 

 

1、创建索引

动词:POST

http://xxx:9200/weiwei-test-index-1

fail:

{
    "error": {
        "root_cause": [
            {
                "type": "index_already_exists_exception",
                "reason": "already exists",
                "index": "weiwei-test-index-1"
            }
        ],
        "type": "index_already_exists_exception",
        "reason": "already exists",
        "index": "weiwei-test-index-1"
    },
    "status": 400
}

success:

http://xxx:9200/weiwei-test-index-2

{
    "acknowledged": true
}

 

2、删除索引

动词:DELETE

和创建索引url一样,只是动词由POST改为DELETE

 

3、创建映射(mapping)

动词:POST

http://xxx:9200/weiwei-test-index-1/weiwei-test-type-1/_mapping?pretty

输入:

{
    "weiwei-test-type-1": {
            "properties": {
                "id": {
                    "type": "integer",
                    "index": "not_analyzed"
                },
				"name": {
                    "type": "string"
                },
				"age": {
                    "type": "integer",
                    "index": "not_analyzed"
                },
				"desc": {
                    "type": "string"
                }
            }
    }
}

输出:

{
    "acknowledged": true
}

4、查看创建的mapping映射

动词:GET

http://xxx9200/weiwei-test-index-1/weiwei-test-type-1/_mapping?pretty

输入:

输出:

{
    "weiwei-test-index-1": {
        "mappings": {
            "weiwei-test-type-1": {
                "properties": {
                    "age": {
                        "type": "integer"
                    },
                    "desc": {
                        "type": "string"
                    },
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    }
                }
            }
        }
    }
}

 

5、插入数据

动词:POST

插入id为1的文档数据

http://xxx:9200/weiwei-test-index-1/weiwei-test-type-1/1

输入:

{
	"name":"weiwei1",
	"age":30,
	"height":174,
	"desc":"hi hello my company and elasticsearch lucence"
}

输出:

{
    "_index": "weiwei-test-index-1",
    "_type": "weiwei-test-type-1",
    "_id": "1",
    "_version": 1,
    "_shards": {
        "total": 2,
        "successful": 2,
        "failed": 0
    },
    "created": true
}

 

6、查询ID为1的文档

动词:GET

http://xxx:9200/weiwei-test-index-1/weiwei-test-type-1/1

输入:

输出:

{
    "_index": "weiwei-test-index-1",
    "_type": "weiwei-test-type-1",
    "_id": "1",
    "_version": 1,
    "found": true,
    "_source": {
        "name": "weiwei1",
        "age": 30,
        "height": 174,
        "desc": "hi hello my company and elasticsearch lucence"
    }
}

 

7、简单查询

7.1、查询前

注:_search 表示是查询请求

关键词解析:

1、term于match(参考:https://blog.csdn.net/sxf_123456/article/details/78845437

term:精确查询,输入的值不会被分词器分词
match:模糊查询,即先分词,再查找

2、match_phase:短语匹配

       1.match_phase中的所有term都出现在待查询字段之中

  2.待查询字段之中的所有term都必须和match_phase具有相同的顺序

3、query_string,类似于match_phase,但不用顺序匹配,而且匹配到一个就行了

4、range:范围查询

5、查询与过滤

查询:进行相关性分析,效率较低

过滤:不进行相关性分析,效率比查询高。

 

 

7.2、精确查找

http://xxx:9200/weiwei-test-index-1/weiwei-test-type-1/_search?pretty

输入:

{
	"profile":false,
	"fields": ["name","desc"], 
    "query": {
        "bool": {
            "must": {
                "term": {
                    "name": "solr"
                }
            }
        }
    }
}

 

输出:

{
    "took": 4,    
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 1,
        "max_score": 0.30685282,
        "hits": [
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "2",
                "_score": 0.30685282,
                "fields": {
                    "name": [
                        "solr"
                    ],
                    "desc": [
                        "hi Solr is base lucence"
                    ]
                }
            }
        ]
    }
}

 

7.3、模糊查找:对被分词的字段进行查找

 

http://xxx:9200/weiwei-test-index-1/weiwei-test-type-1/_search?pretty

分词搜索:

{
	"profile":false,
	"fields": ["name","desc"], 
    "query": {
        "bool": {
            "must": {
                "term": {
                    "desc": "hi Solr is base lucence"
                }
            }
        }
    }
}

输出:

{
    "took": 2,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 0,
        "max_score": null,
        "hits": []
    }
}

未搜到原因:desc字段被分词了,分词有很多分词器,默认使用标准分词器,其中之一是会将空格两边对应的单词拆分并建立索引

 

搜索某个单词:

{
	"profile":false,
	"fields": ["name","desc"], 
    "query": {
        "bool": {
            "must": {
                "term": {
                    "desc": "lucence"
                }
            }
        }
    }
}

 

{
    "took": 3,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 3,
        "max_score": 0.13424811,
        "hits": [
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "2",
                "_score": 0.13424811,
                "fields": {
                    "name": [
                        "solr"
                    ],
                    "desc": [
                        "hi Solr is base lucence"
                    ]
                }
            },
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "3",
                "_score": 0.13424811,
                "fields": {
                    "name": [
                        "lucence"
                    ],
                    "desc": [
                        "what is lucence and solr?"
                    ]
                }
            },
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "1",
                "_score": 0.11506981,
                "fields": {
                    "name": [
                        "weiwei1"
                    ],
                    "desc": [
                        "hi hello my company and elasticsearch lucence"
                    ]
                }
            }
        ]
    }
}

 

7.4、不分词

desc2在创建mapping映射的时候没有被分词。

mapping的字段如果不分词,必须输入完整字段

http://xxx:9200/weiwei-test-index-1/weiwei-test-type-2/_search?pretty

输入:

{
    "query": {
        "bool": {
            "must": {
                "term": {
                    "desc2": "hi hello my company and elasticsearch lucence"
                }
            }
        }
    }
}

输出:

{
    "took": 5,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 1,
        "max_score": 1,
        "hits": [
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-2",
                "_id": "AWlRbTTWumMPR0n84Njs",
                "_score": 1,
                "_source": {
                    "name": "weiwei",
                    "age": 30,
                    "height": 174,
                    "desc": "hi hello my company and elasticsearch lucence",
                    "desc2": "hi hello my company and elasticsearch lucence"
                }
            }
        ]
    }
}

7.5、match查找

会对搜索的字段进行分词,再分别查找每个词的匹配结果并合并

{
	"profile":false,
	"fields": ["name","desc"], 
    "query": {
        "bool": {
            "must": {
                "match": {
                    "desc": "hi Solr is base lucence"
                }
            }
        }
    }
}

输出:

{
    "took": 4,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 3,
        "max_score": 0.7220034,
        "hits": [
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "2",
                "_score": 0.7220034,
                "fields": {
                    "name": [
                        "solr"
                    ],
                    "desc": [
                        "hi the Solr is base lucence"
                    ]
                }
            },
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "3",
                "_score": 0.04908036,
                "fields": {
                    "name": [
                        "lucence"
                    ],
                    "desc": [
                        "what is lucence and solr?"
                    ]
                }
            },
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "1",
                "_score": 0.01581979,
                "fields": {
                    "name": [
                        "weiwei1"
                    ],
                    "desc": [
                        "hi hello my company and elasticsearch lucence"
                    ]
                }
            }
        ]
    }
}

 

7.6、大小写问题

不支持大写输入:ES在对Term建立索引的时候会默认都解析为小写单词

输入:小写的solr

{
	"profile":false,
	"fields": ["name","desc"], 
    "query": {
        "bool": {
            "must": {
                "term": {
                    "desc": "solr"
                }
            }
        }
    }
}

输出:

{
    "took": 3,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 2,
        "max_score": 0.13424811,
        "hits": [
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "2",
                "_score": 0.13424811,
                "fields": {
                    "name": [
                        "solr"
                    ],
                    "desc": [
                        "hi Solr is base lucence"
                    ]
                }
            },
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "3",
                "_score": 0.13424811,
                "fields": {
                    "name": [
                        "lucence"
                    ],
                    "desc": [
                        "what is lucence and solr?"
                    ]
                }
            }
        ]
    }
}

 

输入大写的Solr

{
	"profile":false,
	"fields": ["name","desc"], 
    "query": {
        "bool": {
            "must": {
                "term": {
                    "desc": "Solr"
                }
            }
        }
    }
}

输出:未查到数据

{
    "took": 1,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 0,
        "max_score": null,
        "hits": []
    }
}

 

7.7、match_phrase

http://xxx:9200/weiwei-test-index-1/weiwei-test-type-1/_search?pretty

输入:

{
    "query": {
            "match_phrase": {
                "desc": "Solr is"
            }
    }
}

输出:

{
    "took": 4,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 1,
        "max_score": 0.75,
        "hits": [
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "2",
                "_score": 0.75,
                "_source": {
                    "name": "solr",
                    "age": 31,
                    "height": 174,
                    "desc": "hi the Solr is base lucence"
                }
            }
        ]
    }
}

 

7.8、query_string

http://xxx:9200/weiwei-test-index-1/weiwei-test-type-1/_search?pretty

输入:

{
    "query": {
            "query_string": {
            	"fields" : ["desc","name"],
            	"query" : "Solr is weiwei1"
            }
    }
}

输出:

{
    "took": 3,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 3,
        "max_score": 0.35325736,
        "hits": [
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "2",
                "_score": 0.35325736,
                "_source": {
                    "name": "solr",
                    "age": 31,
                    "height": 174,
                    "desc": "hi the Solr is base lucence"
                }
            },
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "3",
                "_score": 0.031711474,
                "_source": {
                    "name": "lucence",
                    "age": 30,
                    "height": 174,
                    "desc": "what is lucence and solr?"
                }
            },
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "1",
                "_score": 0.018120842,
                "_source": {
                    "name": "weiwei1",
                    "age": 30,
                    "height": 174,
                    "desc": "hi hello my company and elasticsearch lucence"
                }
            }
        ]
    }
}

 

7.9、Range

http://xxx:9200/weiwei-test-index-1/weiwei-test-type-1/_search?pretty

输入:

{
    "query": {
        "range" : {
            "age" : {
                "gte" : 31,
                "lte" : 40
            }
        }
    }
}

输出:

{
    "took": 4,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 1,
        "max_score": 1,
        "hits": [
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "2",
                "_score": 1,
                "_source": {
                    "name": "solr",
                    "age": 31,
                    "height": 174,
                    "desc": "hi the Solr is base lucence"
                }
            }
        ]
    }
}

 

7.10、过滤器

http://xxx:9200/weiwei-test-index-1/weiwei-test-type-1/_search?pretty

输入:

{
  "query" : {
        "filtered" : {
        	"filter" : { 
        		"term" : { "age" : 30 }
        	}
         }
   }
}

 

输出:

{
    "took": 4,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 2,
        "max_score": 1,
        "hits": [
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "1",
                "_score": 1,
                "_source": {
                    "name": "weiwei1",
                    "age": 30,
                    "height": 174,
                    "desc": "hi hello my company and elasticsearch lucence"
                }
            },
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "3",
                "_score": 1,
                "_source": {
                    "name": "lucence",
                    "age": 30,
                    "height": 174,
                    "desc": "what is lucence and solr?"
                }
            }
        ]
    }
}

 

7.11、查看各个分片查询详情

profile显示分片查询详情:作用:当查询请求较慢的时候,可以根据分片查找详情的分片耗时确定分片是否有问题或节点连通性是否良好等

{
	"profile":true,
	"fields": ["name","desc"], 
    "query": {
        "bool": {
            "must": {
                "term": {
                    "name": "solr"
                }
            }
        }
    }
}

 

输出:

{
    "took": 5,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 1,
        "max_score": 0.30685282,
        "hits": [
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "2",
                "_score": 0.30685282,
                "fields": {
                    "name": [
                        "solr"
                    ],
                    "desc": [
                        "hi Solr is base lucence"
                    ]
                }
            }
        ]
    },
    "profile": {
        "shards": [
            {
                "id": "[w3ITy1o9RxypVxkDDhpQbg][weiwei-test-index-1][1]",
                "searches": [
                    {
                        "query": [
                            {
                                "query_type": "BooleanQuery",
                                "lucene": "+name:solr #ConstantScore(_type:weiwei-test-type-1)",
                                "time": "0.06619900000ms",
                                "breakdown": {
                                    "match": 0,
                                    "score": 0,
                                    "create_weight": 44420,
                                    "build_scorer": 0,
                                    "next_doc": 0,
                                    "advance": 0
                                },
                                "children": [
                                    {
                                        "query_type": "TermQuery",
                                        "lucene": "name:solr",
                                        "time": "0.01083200000ms",
                                        "breakdown": {
                                            "match": 0,
                                            "score": 0,
                                            "create_weight": 10832,
                                            "build_scorer": 0,
                                            "next_doc": 0,
                                            "advance": 0
                                        }
                                    },
                                    {
                                        "query_type": "ConstantScoreQuery",
                                        "lucene": "ConstantScore(_type:weiwei-test-type-1)",
                                        "time": "0.01094700000ms",
                                        "breakdown": {
                                            "match": 0,
                                            "score": 0,
                                            "create_weight": 9530,
                                            "build_scorer": 0,
                                            "next_doc": 0,
                                            "advance": 0
                                        },
                                        "children": [
                                            {
                                                "query_type": "TermQuery",
                                                "lucene": "_type:weiwei-test-type-1",
                                                "time": "0.001417000000ms",
                                                "breakdown": {
                                                    "match": 0,
                                                    "score": 0,
                                                    "create_weight": 1417,
                                                    "build_scorer": 0,
                                                    "next_doc": 0,
                                                    "advance": 0
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }
                        ],
                        "rewrite_time": 27796,
                        "collector": [
                            {
                                "name": "SimpleTopScoreDocCollector",
                                "reason": "search_top_hits",
                                "time": "0.002415000000ms"
                            }
                        ]
                    }
                ]
            },
            {
                "id": "[BM_eMt22SbOAleUWHlEelw][weiwei-test-index-1][0]",
                "searches": [
                    {
                        "query": [
                            {
                                "query_type": "BooleanQuery",
                                "lucene": "+name:solr #ConstantScore(_type:weiwei-test-type-1)",
                                "time": "0.06402800000ms",
                                "breakdown": {
                                    "match": 0,
                                    "score": 0,
                                    "create_weight": 43387,
                                    "build_scorer": 0,
                                    "next_doc": 0,
                                    "advance": 0
                                },
                                "children": [
                                    {
                                        "query_type": "TermQuery",
                                        "lucene": "name:solr",
                                        "time": "0.01016100000ms",
                                        "breakdown": {
                                            "match": 0,
                                            "score": 0,
                                            "create_weight": 10161,
                                            "build_scorer": 0,
                                            "next_doc": 0,
                                            "advance": 0
                                        }
                                    },
                                    {
                                        "query_type": "ConstantScoreQuery",
                                        "lucene": "ConstantScore(_type:weiwei-test-type-1)",
                                        "time": "0.01048000000ms",
                                        "breakdown": {
                                            "match": 0,
                                            "score": 0,
                                            "create_weight": 9556,
                                            "build_scorer": 0,
                                            "next_doc": 0,
                                            "advance": 0
                                        },
                                        "children": [
                                            {
                                                "query_type": "TermQuery",
                                                "lucene": "_type:weiwei-test-type-1",
                                                "time": "0.0009240000000ms",
                                                "breakdown": {
                                                    "match": 0,
                                                    "score": 0,
                                                    "create_weight": 924,
                                                    "build_scorer": 0,
                                                    "next_doc": 0,
                                                    "advance": 0
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }
                        ],
                        "rewrite_time": 23151,
                        "collector": [
                            {
                                "name": "SimpleTopScoreDocCollector",
                                "reason": "search_top_hits",
                                "time": "0.001909000000ms"
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

 

7.12、复杂查询

 

http://xxx:9200/weiwei-test-index-1/weiwei-test-type-1/_search?pretty

输入:

{
	"profile":true,
    "query": {
        "bool": {
            "must": {
                "term": {
                    "desc": "lucence"
                }
            },
            "must_not": {
                "term": {
                    "name": "weiwei1"
                }
            },
            "should": [
                {
                    "term": {
                        "height": "174"
                    }
                },
                {
                    "term": {
                        "age": "30"
                    }
                }
            ],
            "minimum_should_match": 1
        }
    }
}

输出:

{
    "took": 3,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
    },
    "hits": {
        "total": 2,
        "max_score": 0.4318313,
        "hits": [
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "3",
                "_score": 0.4318313,
                "_source": {
                    "name": "lucence",
                    "age": 30,
                    "height": 174,
                    "desc": "what is lucence and solr?"
                }
            },
            {
                "_index": "weiwei-test-index-1",
                "_type": "weiwei-test-type-1",
                "_id": "2",
                "_score": 0.07917817,
                "_source": {
                    "name": "solr",
                    "age": 31,
                    "height": 174,
                    "desc": "hi the Solr is base lucence"
                }
            }
        ]
    }
}

 

8、分词

8.1、查看分词结果:

http://xxx:9200/weiwei-test-index-1/weiwei-test-type-1/_validate/query?explain

输入:

{
  "query": {
    "match": {
      "desc": "hi Solr is base lucence"
    }
  }
}

输出:

{
    "valid": true,
    "_shards": {
        "total": 1,
        "successful": 1,
        "failed": 0
    },
    "explanations": [
        {
            "index": "weiwei-test-index-1",
            "valid": true,
            "explanation": "+(desc:hi desc:solr desc:is desc:base desc:lucence) #ConstantScore(+ConstantScore(_type:weiwei-test-type-1))"
        }
    ]
}

 

8.2、根据指定分析器对查询进行分析

http://xxx:9200/weiwei-test-index-1/_analyze?analyzer=Standard

{
    "field": "desc",
    "text": "hi-Solr is base lucence好样的"
}

输出:

{
    "tokens": [
        {
            "token": "hi",
            "start_offset": 0,
            "end_offset": 2,
            "type": "<ALPHANUM>",
            "position": 0
        },
        {
            "token": "solr",
            "start_offset": 3,
            "end_offset": 7,
            "type": "<ALPHANUM>",
            "position": 1
        },
        {
            "token": "is",
            "start_offset": 8,
            "end_offset": 10,
            "type": "<ALPHANUM>",
            "position": 2
        },
        {
            "token": "base",
            "start_offset": 11,
            "end_offset": 15,
            "type": "<ALPHANUM>",
            "position": 3
        },
        {
            "token": "lucence",
            "start_offset": 16,
            "end_offset": 23,
            "type": "<ALPHANUM>",
            "position": 4
        },
        {
            "token": "好",
            "start_offset": 23,
            "end_offset": 24,
            "type": "<IDEOGRAPHIC>",
            "position": 5
        },
        {
            "token": "样",
            "start_offset": 24,
            "end_offset": 25,
            "type": "<IDEOGRAPHIC>",
            "position": 6
        },
        {
            "token": "的",
            "start_offset": 25,
            "end_offset": 26,
            "type": "<IDEOGRAPHIC>",
            "position": 7
        }
    ]
}

 

8.3、标准分析器 指定停用词

http://xxx:9200/weiwei-test-index-1/weiwei-test-type-1/_settings

输入:

{
  "index": {
    "analysis": {
      "analyzer": {
        "standard": {
          "type": "standard",
          "stop_words": [ "it", "is", "a" ]
        }
      }
    }
  }
}

输出:

{
    "_index": "weiwei-test-index-1",
    "_type": "weiwei-test-type-1",
    "_id": "_settings",
    "_version": 1,
    "_shards": {
        "total": 2,
        "successful": 2,
        "failed": 0
    },
    "created": true
}

 

© 著作权归作者所有

下一篇: 总结:Redis集群
浮躁的码农

浮躁的码农

粉丝 76
博文 933
码字总数 194727
作品 0
松江
程序员
私信 提问
Elasticsearch与Solr搜索引擎选型调研文档

Elasticsearch ElasticSearch是一个基于Lucene的搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口。Elasticsearch是用Java开发的,并作为Apache许可条款下的开...

小海bug
2018/06/28
268
0
elasticsearch搜索引擎相关资料(更新中)

最近需要用到elasticsearch搜索引擎,所以搜集了很多相关资料,先放在这里(未详细整理) 一、步骤总结:(linux环境下) 1. 安装 (1)下载elasticsearch安装包:http://www.elasticsearch....

核桃人
2018/03/08
0
0
Elasticsearch简介与实战

什么是Elasticsearch?   Elasticsearch是一个开源的分布式、RESTful 风格的搜索和数据分析引擎,它的底层是开源库Apache Lucene。   Lucene 可以说是当下最先进、高性能、全功能的搜索引...

但盼风雨来_jc
03/06
0
0
spring-data-elasticsearch 基本案例详解(三)

『 风云说:能分享自己职位的知识的领导是个好领导。 』 运行环境:JDK 7 或 8,Maven 3.0+ 技术栈:SpringBoot 1.5+, Spring Data Elasticsearch 1.5+ ,ElasticSearch 2.3.2 本文提纲 一、...

夜黑人模糊灬
2018/05/13
1K
1
如何在 MacOS 上安装 Kibana

Elasticsearch 安装好了之后,Kibana 插件可以为这个功能强大的搜索工具添加可视化功能。 在我之前的文章中,我向 Mac 用户介绍了安装 Elasticsearch 的步骤,这是世界上最受欢迎的企业级搜索...

作者: Lauren Maffeo
07/22
0
0

没有更多内容

加载失败,请刷新页面

加载更多

前端的一些雕虫小技,从100%和滚动条说起

1、100%和滚动条 当我们在css中把html和body同时设为100%时,会出现滚动条 html, body { width: 100%; height: 100%; } 原因是html和b...

wphmoon
30分钟前
6
0
电力区块链应用案例【2019】

随着区块链技术的日益普及,出现了大量创业企业尝试使用区块链技术来解决能源与电力行业中存在的问题。在本文中,我们将介绍其中的三个能源区块链项目。 能源行业以价格不透明著称:消费者很...

汇智网教程
52分钟前
7
0
聊聊rocketmq的adjustThreadPoolNumsThreshold

序 本文主要研究一下rocketmq的adjustThreadPoolNumsThreshold DefaultMQPushConsumer rocketmq-client-4.5.2-sources.jar!/org/apache/rocketmq/client/consumer/DefaultMQPushConsumer.ja......

go4it
今天
9
0
关于早起

早起是非常好的事情,但是像如果前一天睡得晚,或者第二天早上是非常冷的时候,那就不是很美好了。 但是本身早起是一件非常棒的事情,我记得我每次早起 如果不觉得困的话,世界是那么安静,脑...

T型人才追梦者
今天
7
0
Java输入输出

JDK中的InputStream/OutputStream构成了IO输入输出继承层次的基础。它们都是面向字节序列的,每次可以从序列中读入或者写出一个字节或者指定大小的字节数组。但是面向字节流的输入输出不便于...

ytuan996
今天
6
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部