标签:
ElasticSearch查询功能包括query和filter,使用RestAPI:_search方法进行查询。
TODO:Shard query cache.
1,查询匹配this is a test的document。
curl ‘localhost:9200/idx/_search?pretty‘ -d ‘{
"query": {
"match" : {
"message" : "this is a test"
}
}
‘}
2,指定需要返回的字段
curl ‘localhost:9200/idx/_search?pretty‘ -d ‘{
"query": {
"match" : {
"message" : "this is a test"
},
"_source" : ["name"]
}
‘}标签:
原文地址:http://my.oschina.net/pangyangyang/blog/362218