ES_1.1查询接口

时间:2014-12-30 13:41:37   收藏:0   阅读:321

ElasticSearch查询功能包括query和filter,使用RestAPI:_search方法进行查询。

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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!