in查询
{
"query": {
"bool": {
"must": [
{
// 区间查询
"range": {
"friend_created": {
"lte": 1656405864,
"gte": 1651221864
}
}
},
{
// not in查询
"bool": {
"must_not": {
"terms": {
"info_id": [
"75047",
"74661",
"295",
"52827",
"45",
"16",
"17264"
]
}
}
}
},
"bool": {
// OR 查询
"should": [
{
"bool": {
"must": [
{
"term": {
"info_type": {
"value": 1
}
}
},
{
"range": {
"friend_created": {
"gte": 10
}
}
}
]
}
},
{
"bool": {
"must_not": [
{
"term": {
"info_type": {
"value": 1
}
}
}
]
}
}
]
}
],
"must_not": [],
"filter": [
{
// 等于
"term": {
"is_recommend": 1
}
},
{
"term": {
"info_type": 1
}
},
{
"term": {
"is_del": 0
}
},
{
"term": {
"is_check": 1
}
},
[
// in查询
{
"terms": {
"tag_ids": [
43,
26,
41,
47,
29,
36,
34,
40,
21,
24
]
}
}
]
]
}
},
// 排序
"sort": {
"friend_created": {
"order": "desc"
}
}
}
1.删除索引数据
1.删除索引数据
POST /索引名称/_delete_by_query
{
"query": {
"bool": {
"must_not": [
{
"match": {
"test": "字段值"
}
}
]
}
}
}
2查询
GET /v_all_es/_search
{
"query": {
"bool": {
"must": [
{"terms": {"info_type":[60,61,68,69,65]}
},{
"bool": {
"should": [
{
"bool": {
"must": [
{
"term": {
"is_close": 0
}
}
]
}
}
]
}
}
]
}
}
}
GET /v_all_es/_mapping
//删除索引数据
DELETE /v_all_es/_doc/684-68/
POST /v_all_es/_delete_by_query
{
"query": {
"bool": {
"must": [
{"terms": {"info_type":[60,61,68,69,65]}
}
]
}
}
}
ES 15 - Elasticsearch中的数据类型 (text、keyword、date、geo等) - 技术经验 - W3xue
1万+



被折叠的 条评论
为什么被折叠?



