how to search multi types data in elasticsearch just like db's compound query. I am a green hand about elasticsearch ,I want to kown how to query data which in diffrent types.
Asked
Active
Viewed 55 times
-1
-
can you add some mappings, schema, sample documents to support your post – user3775217 Feb 05 '17 at 14:41
2 Answers
0
You can do this by putting comma between your types or indexes. For example, check the below example to match all your docs your multiple type
GET books/fiction,adventure/_search
{
"query": {
"match_all": {}
}
}
And also, you can search on multiple indexes:
GET logstash-*/warning/_search
{
"query": {
"match_all": {}
}
}
With this query, you can search on all the indexes whose name is start with "logstash-" or like type, comma will work for indexes.
You can check this doc to get more information.

hkulekci
- 1,894
- 15
- 27
-
-
Because tha answer is not related search condition. that is releated with url of the query – hkulekci Feb 06 '17 at 05:28
-
-
-
select * from t1 left join t2 on t1.id=t2.c_id left join t3 on ......where t1.name='' and t2.age>3.... – qsmy_qin Feb 07 '17 at 07:45
-
You dont need any join if you use nosql. You should add your joined datas to your documents. – hkulekci Feb 07 '17 at 07:53
-
Please give your table example and I will try to create you an example structure. – hkulekci Feb 07 '17 at 07:54
0
I am not sure if i understood you correctly but in ES you can search acroos multiple indexes and types see link
GET /twitter/tweet,user/_search?q=user:kimchy
This will search on tweet and user types

Vova Bilyachat
- 18,765
- 4
- 55
- 80