Solr:DocValuesField在本文档中出现多次(Solr 6.5)
升级到Solr 6.5后,当我尝试将记录插入字段时,收到此错误 完全错误:Solr:DocValuesField在本文档中出现多次(Solr 6.5),solr,Solr,升级到Solr 6.5后,当我尝试将记录插入字段时,收到此错误 完全错误: 2017-06-05 02:57:40,685 ERROR [org.apache.solr.client.solrj.impl.CloudSolrClient] - Request to collection <collection> failed due to (400) org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrExcept
2017-06-05 02:57:40,685 ERROR
[org.apache.solr.client.solrj.impl.CloudSolrClient] - Request to collection
<collection> failed due to (400)
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error
from server at http://<host>:8983/solr/<collection>: Exception
writing document id <number> to the index; possible analysis error:
DocValuesField "location_field_0_coordinate" appears
more than once in this document (only one value is allowed per field)
<field name="location_field" type="locations" indexed="true" stored="true" required="false" multiValued="true" />
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
2017-06-05 02:57:40685错误
[org.apache.solr.client.solrj.impl.CloudSolrClient]-请求收集
由于(400)而失败
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:错误
从位于http://:8983/solr/:Exception的服务器
将文档id写入索引;可能的分析错误:
出现DocValuesField“location\u field\u 0\u坐标”
此文档中不止一次(每个字段只允许一个值)
字段声明:
2017-06-05 02:57:40,685 ERROR
[org.apache.solr.client.solrj.impl.CloudSolrClient] - Request to collection
<collection> failed due to (400)
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error
from server at http://<host>:8983/solr/<collection>: Exception
writing document id <number> to the index; possible analysis error:
DocValuesField "location_field_0_coordinate" appears
more than once in this document (only one value is allowed per field)
<field name="location_field" type="locations" indexed="true" stored="true" required="false" multiValued="true" />
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
类型声明(位置):
2017-06-05 02:57:40,685 ERROR
[org.apache.solr.client.solrj.impl.CloudSolrClient] - Request to collection
<collection> failed due to (400)
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error
from server at http://<host>:8983/solr/<collection>: Exception
writing document id <number> to the index; possible analysis error:
DocValuesField "location_field_0_coordinate" appears
more than once in this document (only one value is allowed per field)
<field name="location_field" type="locations" indexed="true" stored="true" required="false" multiValued="true" />
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
根据文档,
solr.LatLonType
不支持多值字段
<fieldType name="location" class="solr.LatLonPointSpatialField" docValues="true"/>
它出现在Solr6.5中,检查将多个值插入Solr.LatLonType的条件发生了变化
在Solr6.3中,我能够成功地将多个位置插入到Solr.LatLonType
字段类型中
解决方案:
您应该将位置
字段类型替换为LatLonPointSpatialField
,这是支持多值字段的solr.LatLonType
的替代品
<fieldType name="location" class="solr.LatLonPointSpatialField" docValues="true"/>
见: