elasticsearch-sql
elasticsearch-sql copied to clipboard
不能支持copy_to的字段检索吗
可以
curl -X PUT "localhost:9200/my-index-000001?pretty" -H 'Content-Type: application/json' -d'
{
"mappings": {
"properties": {
"first_name": {
"type": "text",
"copy_to": "full_name"
},
"last_name": {
"type": "text",
"copy_to": "full_name"
},
"full_name": {
"type": "text"
}
}
}
}
'
curl -X PUT "localhost:9200/my-index-000001/_doc/1?pretty" -H 'Content-Type: application/json' -d'
{
"first_name": "John",
"last_name": "Smith"
}
'
SELECT * FROM my-index-000001 where full_name=match_query('John Smith')