我使用JDBC河加載數據Elasticsearch完成現場:使用JDBC河
curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
"type": "jdbc",
"jdbc": {
"url": "jdbc:mysql://localhost:3306/test",
"user": "root",
"password": "root",
"sql": "SELECT TAD.ID AS _id, TAD.APP_NAME AS appName FROM TOPIC_APP_DETAILS TAD ",
"index": "app_index",
"type": "app_type",
"mappings": {
"app_type": {
"properties": {
"appName": {
"type": "completion"
}
}
}
}
}
}
當我執行下面的查詢得到ClassCastException異常[org.elasticsearch.index.mapper.core.StringFieldMapper不能轉換爲org.elasticsearch.index.mapper.core.CompletionFieldMapper];
curl -X POST 'localhost:9200/app_index/_suggest?pretty' -d '{
"app-suggest" : {
"text" : "cri",
"completion" : {
"field" : "appName"
}
}
}
請建議我在這裏失蹤。