使用netstat -lntp来看看有侦听在网络某端口的进程。当然,也可以使用 lsof。

父子关系中,如何“同时”获取父、子详细数据?

Elasticsearch | 作者 wushen | 发布于2017年01月15日 | 阅读数:5008

在不讨论父子关系是否合适、能否避免的情况下,如何针对父子关系中,如何“同时”获取父子的详细数据呢?
 
看到github上的讨论:
https://github.com/elastic/ela ... s/761  
 


By far the most efficient way of doing this is in two queries:

retrieve the top 10 parents matching the query
use an msearch to find (eg) the top 10 children for each parent id

While this requires two steps, it gives you all the flexibility you need which would otherwise have to be provided by adding new structures to the query dsl and to the response.


已邀请:

wushen

赞同来自: novia

inner_hits已经解决该问题。
 
https://www.elastic.co/guide/e ... .html  


In many cases, it’s very useful to know which inner nested objects (in the case of nested) or children/parent documents (in the case of parent/child) caused certain information to be returned. The inner hits feature can be used for this. This feature returns per search hit in the search response additional nested hits that caused a search hit to match in a different scope.
 

{ "query" : 
   { "has_child" : 
      { "type" : "comment", 
        "query" : { "match" : {"message" : "[actual query]"} }, 
        "inner_hits" : {} 
       } 
   } 
}
 

300斤的胖子

赞同来自:

请教下,java 中如何定义父子关系啊

dongchunfu - 80后IT 男

赞同来自:

先生命夫映射,在创建子时指定其父亲。父子应该是同一索引下的不同type

要回复问题请先登录注册