Kibana中ES搜索常用命令
PUT /cc/_settings
{"index.blocks.read_only_allow_delete": false}
PUT /_all/_settings
{"index.blocks.read_only_allow_delete": null}
POST /cc/_forcemerge?only_expunge_deletes=true
DELETE cc
GET _search
{
"query": {
"match_all": {}
}
}
GET cc/_settings?pretty
GET cc/_search
{
"query": {
"bool": {
"must": [
{"match": {
"id": "10876"
}}
]
}
}
}
GET cc
GET cc/cc_question/mapping
GET cc/_search
{
"query": {
"match_all": {}
}
}
GET cc/_search
{
"query": {
"bool": {
"must": [
{
"wildcard": {
"code.keyword": "*2015*"
}
}
]
}
}
}
GET cc/_search
{
"query": {
"bool": {
"must": [
{"match": {
"knowledgePoint": "1"
}},{
"match": {
"questionLevelId": "1"
}
},{
"match": {
"questionSourceId": "1"
}
},{
"match": {
"code": "AMC8"
}
}
]
}
},
"from": 0,
"size": 20
}
GET cc/_search
{
"query": {
"match": {
"properties.questionNumber": 6
}
}
}
GET cc/_search
{
"query": {
"match": {
"knowledgePoint": "2"
}
},
"sort": {
"_script": {
"script": "Math.random()",
"type": "number",
"order": "asc"
}
},
"from": 0,
"size": 2
}
GET cc/_search
{
"query": {
"match": {
"questionSourceId": "3"
}
}
}
GET cc/_search
{
"query": {
"match": {
"id": "256"
}
}
}
GET cc/_search
{
"query": {
"match": {
"subjectId": "1"
}
}
}
GET cc/_search
{
"query": {
"bool": {
"filter": {
"term": {
"knowledgePoint": "1"
}
}
}
}
}
# must 必须满足(影响算分的),must_not 必须不满足,should 必须满足其中一条,filter 必须满足(不影响算分)
GET cc/_search
{
"size": 3,
"query": {
"bool": {
"must": [
{"term": {
"subjectId": {
"value": "1"
}
}},
{"term": {
"type": {
"value": "1"
}
}}
],
"must_not": [
{"term": {
"questionSourceId": {
"value": "23"
}
}}
],
"should": [
{"term": {
"category": {
"value": "2"
}
}},
{
"term": {
"category": {
"value": "1"
}
}
}
]
}
}
}
GET cc/_search
{
"query": {
"match": {
"questionSourceId": "3"
}
},
"aggs": {
"all": {
"terms": {
"field": "questionSourceId"
}
}
}
}
GET cc/_search
{
"query": {
"match": {
"subjectId": "1"
}
},
"aggs": {
"all": {
"terms": {
"field": "questionLevelId"
}
}
}
}
GET cc/_search
{
"aggs": {
"all_interests": {
"terms": { "field": "questionLevelId" },
"aggs": {
"NAME": {
"terms": {"field":"questionSourceId"}
}
}
}
}
}
GET cc/_search
{
"aggs": {
"questionSourceIds": {
"terms": { "field": "questionSourceId" },
"aggs": {
"questionLevelIds": {
"terms": {"field":"questionLevelId"}
}
}
}
} ,
"from": 0,
"size": 0
}
GET cc/_search
{
"aggs": {
"questionSourceIds": {
"terms": { "field": "questionSourceId" },
"aggs": {
"questionLevelIds": {
"terms": {"field":"questionLevelId"}
}
}
}
} ,
"from": 0,
"size": 0
}
GET cc/_search
{
"size": 0,
"aggs": {
"NAME": {
"terms": {
"field": "questionSourceId",
"size": 10
},
"aggs": {
"ava": {
"avg": {
"field": "questionLevelId"
}
}
}
}
}
}
PUT /_all/_settings
{"index.blocks.read_only_allow_delete": false}
GET _cluster/nodes
GET _cluster/state
GET _cluster/health
GET _cluster/health?level=indices
DELETE cc
GET cc
GET cc/_stats
GET cc/_settings?pretty
GET _cluster/health
GET _cat/indices
以上是 Kibana中ES搜索常用命令 的全部内容, 来源链接: utcz.com/z/510944.html