GET user/_search
{
"query": {
"match_all": {}
},
"from": 4,
"size": 4
}




GET user/_search
{
"query": {
"match": {
"address": "street"
}
}
}

GET user/_search
{
"query": {
"match_phrase": {
"address": "Madison Street"
}
}
}

POST resume/_doc/12
{
"title":"后端工程师",
"desc":"多年go语言开发经验,熟悉go的基本语法",
"want_learn":"python语言"
}
POST resume/_doc/13
{
"title":"go工程师",
"desc":"多年开发经验",
"want_learn":"java语言"
}
POST resume/_doc/14
{
"title":"工程师",
"desc":"go多年开发经验",
"want_learn":"java语言"
}
GET resume/_search
{
"query": {
"multi_match": {
"query": "go",
"fields": ["title","desc"]
}
}
}

GET resume/_search
{
"query": {
"multi_match": {
"query": "go",
"fields": ["title^2","desc"]
}
}
}

GET user/_search
{
"query": {
"query_string": {
"query": "Madison Street"
}
}
}





GET user/_search
{
"query": {
"range": {
"age": {
"gte": 20,
"lte": 30
}
}
}
}

#插入一条测试数据
POST user/_doc
{
"school":"middle school"
}
#查询所有有school字段的数据
GET user/_search
{
"query": {
"exists": {
"field": "school"
}
}
}


#match中使用模糊匹配
#每个分词都会进行模糊匹配
GET user/_search
{
"query": {
"match": {
"address":{
"query": "Midison streat",
"fuzziness": 1
}
}
}
}


{
"query": {
"bool": {
"must": [
],
"should": [
],
"must_not": [
],
"filter": [
],
}
}
}
GET user/_search
{
"query": {
"bool": {
"must": [
{
"term": {
"state": "tn"
}
},
{
"range": {
"age": {
"gte": 20,
"lte": 30
}
}
}
],
"must_not": [
{
"term": {
"gender": "m"
}
}
],
"should": [
{
"match": {
"firstname": "Decker"
}
}
],
"filter": [
{
"range": {
"age": {
"gte": 25,
"lte": 30
}
}
}
]
}
}
}






PUT usertest
{
"mappings": {
"properties": {
"age":{
"type": "integer"
},
"name":{
"type": "text"
},
"desc":{
"type": "keyword"
}
}
}
}



GET _analyze
{
"analyzer": "standard",
"text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
}

GET _analyze
{
"analyzer": "simple",
"text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
}

GET _analyze
{
"analyzer": "stop",
"text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
}

GET _analyze
{
"analyzer": "whitespace",
"text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
}

GET _analyze
{
"analyzer": "keyword",
"text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
}

GET _analyze
{
"analyzer": "pattern",
"text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
}

GET _analyze
{
"analyzer": "english",
"text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
}


GET usertest/_search
{
"query": {
"match": {
"desc":{
"query": "671 Bristol Street",
"analyzer": "keyword"
}
}
}
}


POST cn/_doc
{
"name":"中华牙膏"
}
GET cn/_search
{
"query": {
"match": {
"name": "中立"
}
}
}
GET _analyze
{
"text": "中华牙膏"
}



GET _analyze
{
"text": "中华牙膏",
"analyzer": "ik_smart"
}

GET _analyze
{
"text": "中国科学技术大学",
"analyzer": "ik_max_word"
}


GET _analyze
{
"text": "好网不的课程",
"analyzer": "ik_smart"
}







