1、regexp query——使用正则表达式术语查询
POST /your_index/_search
{
"query": {
"regexp":{
"name.first": "s.*y"
}
}
}
注意:regexp查询的性能在很大程度上取决于所选的正则表达式。匹配所有类似的东西.*都很慢,而且使用环视正则表达式也很慢。如果可能,应在正则表达式开始之前尝试使用长前缀。
2、type query
筛选与提供的文档/映射类型匹配的文档。【几乎无用,因为 type 在7.x已被弃用,并将在8.x版本中被删除】
POST /your_index/_search
{
"query": {
"type" : {
"value" : "_doc"
}
}
}
3、ids query
根据index的_id 字段检索文档
POST /your_index/_search
{
"query": {
"ids" : {
"type" : "_doc",
"values" : ["1", "4", "100"]
}
}
}