我试图在Solr中设置一个多值字段,但在我的情况下失败了!!
数据库查询结果(示例)
|id | another_id | name | phone | type |
|----------------------------------------------------------------|
|'1' | '11' | 'F. Brown' | '112233440' | 'employee' |
|'2' | '22' | 'Jhon Smith' | '123123123' | 'guest' |
|'2' | '22' | 'Jhon Smith' | '321321321' | 'guest' |
Solr-data-config.xml文件
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/servme_prd"
user="root"
password="root" />
托管架构.xml
uid
无论何时,我执行完全导入,我都不会将电话作为多值字段获取;示例solr查询响应:
{
"name":"F. Brown",
"uid":"1",
"pid":"11",
"phone":["112233440"],
"type":"employee"
"_version_":1608065390436417536
},
{
"name":"Jhon Smith",
"uid":"2",
"pid":"22",
"phone":["123123123"],
"type":"guest"
"_version_":1608065390436417536
},
{
"name":"Jhon Smith",
"uid":"2",
"pid":"22",
"phone":["321321321"],
"type":"guest"
"_version_":1608065390436417536
}
我想从solr query search得到以下响应:
{
"name":"F. Brown",
"uid":"1",
"pid":"11",
"phone":["112233440"],
"type":"employee"
"_version_":1608065390436417536
},
{
"name":"Jhon Smith",
"uid":"2",
"pid":"22",
"phone":["123123123", "321321321"],
"type":"guest"
"_version_":1608065390436417536
}
solr配置部分缺少任何内容,所以我没有让多值字段按预期工作?
顺便说一句,我使用的是安装在ubuntu 14服务器上的Solr 7.4。
谢谢