如何查看 elasitelastaticsearchh doc

linux脚本中执行命令_百度知道
linux脚本中执行命令
比如 我有一个程序要启动 他正常的启动指令是./elasitcsearch -d 但是我有很多个程序 我不想一一记住每个程序的启动指令 于是我想在每个程序主目录下创建一个shell脚本 叫start.shell 让start.h去完成启动的任务 也就是把./elasticsearch -d这个命令写到脚本里...
我有更好的答案
then# 启动命令;esacif [[ &$DEBUG -eq 1 &]];exit 10elseecho 启动命令只能使用#.想要启动的程序名)exit 7fi不过我怎么觉得好奇怪呢./elasitcsearch -d&echo &程序已启动&quot!/bin/bash#echo hiDEBUG=0case $1 in想要启动的程序名)DEBUG=1 ;
采纳率:73%
如果不加上./的意思是说在当前的工作目录下执行hello.sh./hello.sh切换到shell脚本所在的目录(此时。查看PATH的内容可用 echo $PASH 命令./,不在环境变量PASH的内容之中,称为工作目录)执行shell脚本:复制代码 代码如下:cd /data&#47。现在的/shell,bash可能会响应找到不到hello.sh的错误信息。因为目前的工作目录(/data/shell)可能不在执行程序默认的搜索路径之列,也就是说;data/shell就不在环境变量PASH中的,所以必须加上.&#47
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。他的最新文章
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)elasticsearch - querying elasitcsearch parent child documents - Stack Overflow
Join Stack Overflow to learn, share knowledge, and build your career.
or sign in with
We work with two types of documents on elastic search (ES): items and slots, where items are parents of slot documents.
We define the index with the following command:
curl -XPOST 'localhost:9200/items' -d @itemsdef.json
where itemsdef.json has the following definition
"mappings" : {
"item" : {
"properties" : {
"id" : {"type" : "long" },
"name" : {
"type" : "string",
"_analyzer" : "textIndexAnalyzer"
"location" : {"type" : "geo_point" },
"settings" : {
"analysis" : {
"analyzer" : {
"activityIndexAnalyzer" : {
"alias" : ["activityQueryAnalyzer"],
"type" : "custom",
"tokenizer" : "whitespace",
"filter" : ["trim", "lowercase", "asciifolding", "spanish_stop", "spanish_synonym"]
"textIndexAnalyzer" : {
"type" : "custom",
"tokenizer" : "whitespace",
"filter" : ["word_delimiter_impl", "trim", "lowercase", "asciifolding", "spanish_stop", "spanish_synonym"]
"textQueryAnalyzer" : {
"type" : "custom",
"tokenizer" : "whitespace",
"filter" : ["trim", "lowercase", "asciifolding", "spanish_stop"]
"filter" : {
"spanish_stop" : {
"type" : "stop",
"ignore_case" : true,
"enable_position_increments" : true,
"stopwords_path" : "analysis/spanish-stopwords.txt"
"spanish_synonym" : {
"type" : "synonym",
"synonyms_path" : "analysis/spanish-synonyms.txt"
"word_delimiter_impl" : {
"type" : "word_delimiter",
"generate_word_parts" : true,
"generate_number_parts" : true,
"catenate_words" : true,
"catenate_numbers" : true,
"split_on_case_change" : false
Then we add the child document definition using the following command:
curl -XPOST 'localhost:9200/items/slot/_mapping' -d @slotsdef.json
Where slotsdef.json has the following definition:
"slot" : {
"_parent" : {"type" : "item"},
"_routing" : {
"required" : true,
"path" : "parent_id"
"properties": {
"id" : { "type" : "long" },
"parent_id" : { "type" : "long" },
"activity" : {
"type" : "string",
"_analyzer" : "activityIndexAnalyzer"
"day" : { "type" : "integer" },
"start" : { "type" : "integer" },
{ "type" : "integer" }
Finally we perform a bulk index with the following command:
curl -XPOST 'localhost:9200/items/_bulk' --data-binary @testbulk.json
Where testbulk.json holds the following data:
{"index":{"_type": "item", "_id":35}}
{"location":[40.4,-3.6],"id":35,"name":"A Name"}
{"index":{"_type":"slot","_id":126,"_parent":35}}
{"id":126,"start":1330,"day":1,"end":1730,"activity":"An Activity","parent_id":35}
I'm trying to make the following query: search for all items within a certain distance to a location that have children (slots) in the specified days and within certain start and end ranges.
An item with more slots fulfilling the condition should score higher.
I tried starting with existing samples but the docs are really scarce and its hard to move forward.
3,07932437
I don't think there is a way to write an efficient query that would do something like this without moving location to slots. You can do something like this, but it can quite inefficient for some data:
"query": {
"top_children" : {
"type": "blog_tag",
"query" : {
"constant_score" : {
"query" : {
... your query for children goes here ...
"score" : "sum",
"factor" : 5,
"incremental_factor" : 2
"filter": {
"geo_distance" : {
"distance" : "200km",
"location" : {
"lat" : 40,
"lon" : -70
Basically, what this query is doing is this, it takes your range query or filter for children and whatever other conditions you need and wraps it into constant_score query to make sure that all children have score of 1.0. The top_children query collects all these children and accumulates their scores to the parents. And then filter filters out parents that are too far away.
25.3k36868
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled他的最新文章
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)青云QingCloud推出Elasticsearch全文搜索引擎服务
北京日电 /美通社/ -- 为了进一步满足用户对纯文本搜索,以及实时数据索引、搜索和分析的需求,企业级基础云服务商青云QingCloud(qingcloud.com)日前宣布正式推出Elasticsearch分布式全文搜索引擎服务。通过Elasticsearch服务,用户能够方便地创建和管理Elasticsearch集群,支持在线横向与纵向伸缩,且用户业务的连续性不会因此而中断。此外,QingCloud还提供了丰富的监控告警等服务来帮助用户更好地管理集群。
青云QingCloud Elasticsearch服务 Elasticsearch是一个具有分布式、高可用架构的全文搜索和分析引擎,基于Lucene构建,提供RESTful接口,主要用于纯文本搜索、实时数据处理和分析。Elasticsearch还具有面向文本、Schema-Free、开发者友好等特性。此外,Logstash日志收集工具和Kibana可视化分析工具等Elasticsearch生态圈成员也将在QingCloud映像市场中同步推出。
Elasticsearch适用于站内搜索、文档数据库、地理位置混合查询、日志以及监控数据的保存和检索分析等应用场景。青云QingCloud提供的Elasticsearch集群服务支持1-N个节点,但其中3个节点以下的Elasticsearch建议只在测试环境使用,生产环境至少3个节点,同时建议节点数不要超过20个。
QingCloud Elasticsearch服务亮点如下:
安全性:为了更好地保障数据的安全,Elasticsearch集群需要运行在受管私有网络中,结合QingCloud提供的高性能硬盘,在保障高性能的同时兼顾用户的数据安全。 在线伸缩:支持在线横向和纵向伸缩,且不影响用户业务的连续性。当业务压力增大时,用户可以通过增加节点横向扩展集群;当业务压力变小时,也可以通过删除节点,节约资源和费用。此外,Elasticsearch节点的CPU和内存配置也可以纵向伸缩,磁盘空间不足时也可以扩容。 监控告警:QingCloud提供了丰富的监控和告警服务,以帮助用户更好地管理和维护Elasticsearch 集群。其中,监控服务包括CPU 使用率、内存使用率、硬盘使用率等。 QingCloud Elasticsearch 服务内置了以下常用插件,暂不支持用户自己上传安装插件:
analysis-ic:使用ICU实现的一个针对亚洲语言的分词器插件; analysis-kuromoji:使用Kuromoji实现的一个日语的分词器插件; analysis-smartcn:针对中文或者中英文混合的文本的分词器插件; mapper-attachments:使用Apache Tika实现的用来解析PDF Microsoft Word文档的插件; elasitcsearch-kopf:kopf 是一个开源的Elasticsearch web管理工具。 青云QingCloud CTO 甘泉(Reno Gan)表示,Elasticsearch服务的推出进一步完善了QingCloud的基础数据平台。接下来,青云QingCloud还会推出Storm、HBase、Hue等一系列功能和产品,携手AppCenter合作伙伴打造完整的数据产品云生态。
科技,洞见未来。7月28日,QingCloud Insight 2016与您相约北京(官网报名:http://insight.qingcloud.com/?bag_track=media)。
责任编辑:
声明:本文由入驻搜狐号的作者撰写,除搜狐官方账号外,观点仅代表作者本人,不代表搜狐立场。
今日搜狐热点

我要回帖

更多关于 elasitcsearch6 java 的文章

 

随机推荐