elasticsearch - querying multiple indexes is possible?

前端 未结 3 1954
小鲜肉
小鲜肉 2020-12-02 15:26

I have an elasticsearch cluster with 3 indexes:

/users/user
/events/visit
/events/register
/pages/page

So, now I need to run queries proces

3条回答
  •  暖寄归人
    2020-12-02 16:07

    By not limiting our search to a particular index or type, we have searched across all documents in the cluster. Elasticsearch forwarded the search request in parallel to a primary or replica of every shard in the cluster.

           1)/users,events,pages/_search : Search all types in the users,events and pages
    
           2)/u*,e*,p*/_search : Search all types in any indices beginning with u,e or beginning with p
    
           3)/events/visit,register/_search : Search types visit and register in the events index
    
           4) /_all/user,visit,register,page/_search : Search types users,events and pages in specified indices
    

提交回复
热议问题