知乎专栏 | 多维度架构 |
搜索所有内容
# curl -XGET 'http://localhost:9200/_search?pretty' # curl -XGET 'http://localhost:9200/_all/_search?pretty'
指定 _index 搜索
# curl -XGET 'http://localhost:9200/website/_search?pretty' # curl -XGET 'http://localhost:9200/website/news/_search?pretty'
指定 _type 搜索
# curl -XGET 'http://localhost:9200/website,twitter/_search?pretty' # curl -XGET 'http://localhost:9200/website/news,blog/_search?pretty' # curl -XGET 'http://localhost:9200/website,twitter/news,blog/_search?pretty'
所有 _index 包含指定 _type 搜索
# curl -XGET 'http://localhost:9200/_all/news,blog/_search?pretty'
字符串搜索
# curl -XGET 'http://localhost:9200/_all/_search?q=neo&pretty'
同时满足两个条件
+name:neo +age:30
查找name为mary 或者 john的数据
+name:(mary john)
查询姓名是neo或者jam并且年龄小于30岁同时1980-09-10之后出生的
+name:(neo jam) +age:<30 +date:>1980-09-10