ElasticSearch安装:Linux有效
第一步:到https://www.elastic.co/downloads网址下载zip压缩包,并解压
第二步:Linux系统中使用非root用户操作
启动方法:Linux运行方法:./bin/elasticsearch;Windows运行方法:./bin/elasticsearch.bat即可
停止方法:Ctrl+C快捷键即可;
Marvel插件安装:
第一步:./plugin install license
第二步:./plugin install marvel-agent,安装之后没有显示界面
第三步:在https://download.elastic.co/elasticsearch/marvel/marvel-latest.zip地址下载zip压缩包
第四步:将marvel-1.3.1.zip解压之后,将_site文件夹拷贝到XX/elasticsearch-2.4.1/plugins/marvel-agent路径下。更改_site文件夹的权限:chown -R xx:xx _site之后才能使用.
第五步:访问http://localhost:9200/_plugin/marvel-agent即可。
Head插件安装:
文档操作:
创建索引:curl -XPUT 'http://localhost:9200/dept/employee/1' -d '{ "empname": "emp1"}'
检索文档:curl -XGET 'http://localhost:9200/dept/employee/1'
删除文档:curl -XDELETE 'http://localhost:9200/dept/employee/1'
简单搜索:curl -XGET 'http://localhost:9200/dept/employee/_search' 默认情况下搜索会返回前10个结果。
查询字符串(query string)搜索:curl -XGET 'http://localhost:9200/dept/employee/_search?q=empname:emp7'
DSL查询(Query DSL):
DSL(Domain Specific Language特定领域语言)以JSON请求体的形式出现。