ElasticSearch 多索引,ElasticSearch索引
1、用逗号将索引隔开,如:
$ curl -XPOST http://localhost:9200/aaa,website/_search/
{
- "took": 1,
- "timed_out": false,
- "_shards": {
- "total": 10,
- "successful": 10,
- "failed": 0
}, - "hits": {
- "total": 5,
- "max_score": 1,
- "hits": [
- {
- "_index": "website",
- "_type": "blog",
- "_id": "123",
- "_score": 1,
- "_source": {
- "title": "My first blog entry",
- "text": "Just trying this out...",
- "date": "2014/01/01"
}
}, - {
- "_index": "website",
- "_type": "blog",
- "_id": "AVbkih8AltSLRRB7XAun",
- "_score": 1,
- "_source": {
- "title": "TestTitle",
- "text": "text",
- "date": "2016/09/01"
}
}, - {
- "_index": "website",
- "_type": "blog",
- "_id": "AVbf1AtSyvALLDk8cjpY",
- "_score": 1,
- "_source": {
- "title": "My 3 blog entry",
- "text": "Still trying this out...",
- "date": "2014/01/01"
}
}, - {
- "_index": "aaa",
- "_type": "aaa",
- "_id": "AVcCopjQzgrwoUDkEMu3",
- "_score": 1,
- "_source": {
- "str1": "hello",
- "str2": "world"
}
}, - {
- "_index": "aaa",
- "_type": "aaa",
- "_id": "AVcCogrMzgrwoUDkEMu2",
- "_score": 1,
- "_source": {
- "str1": "hello, world!",
- "str2": "goodbye! world"
}
}
]
}
}
2、通配符
elasticsearch还支持使用统配的风格,如使用*匹配任意字符。
3、数学表达式风格
最后可以通过add(+)添加一个索引,使用remove(-)去掉一个索引
http://www.htsjk.com/Elasticsearch/35090.html
www.htsjk.Com
true
http://www.htsjk.com/Elasticsearch/35090.html
NewsArticle
ElasticSearch 多索引,ElasticSearch索引 1、用逗号将索引隔开,如: $ curl -XPOST http://localhost:9200/aaa,website/_search/ { "took" : 1 , "timed_out" : false , "_shards" : { "total" : 10 , "successful" : 10 , "fai...
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。