curl -XPUT 'localhost:9200/my_index/groups/1?pretty' -H 'Content-Type: application/json' -d'
{
"names": [ "John Abraham", "Lincoln Smith"]
}
'
curl -XGET 'localhost:9200/my_index/groups/_search?pretty' -H 'Content-Type: application/json' -d'
{
"query": {
"match_phrase": {
"names": {
"query": "Abraham Lincoln" #1
}
}
}
}
'
curl -XGET 'localhost:9200/my_index/groups/_search?pretty' -H 'Content-Type: application/json' -d'
{
"query": {
"match_phrase": {
"names": {
"query": "Abraham Lincoln",
"slop": 101 #2
}
}
}
}
'
curl -XPUT 'localhost:9200/my_index?pretty' -H 'Content-Type: application/json' -d'
{
"mappings": {
"groups": {
"properties": {
"names": {
"type": "text",
"position_increment_gap": 0 #1
}
}
}
}
}
'
curl -XPUT 'localhost:9200/my_index/groups/1?pretty' -H 'Content-Type: application/json' -d'
{
"names": [ "John Abraham", "Lincoln Smith"]
}
'
curl -XGET 'localhost:9200/my_index/groups/_search?pretty' -H 'Content-Type: application/json' -d'
{
"query": {
"match_phrase": {
"names": "Abraham Lincoln" #2
}
}
}
'