我正在尝试将 Id 字段用作 Long 并收到此错误:
ERROR: Error CREATEing SolrCore 'brands': Unable to create core
[brands] Caused by: uniqueKey field (id) can not be configured to use a
Points based FieldType: plong
这是我的 schema.xml:
<?xml version="1.0" encoding="UTF-8"?>
<schema name="brands-config" version="1.6">
<uniqueKey>id</uniqueKey>
<fieldType name="plong" class="solr.LongPointField" docValues="true"/>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true"/>
<field name="name" type="string"/>
<field name="id" type="plong" multiValued="false" indexed="true" required="true" stored="true"/>
</schema>
我的 solrconfig.xml 是基本的 - 只删除了提到的部分 in this thread但它没有帮助。
有没有办法让我的 id 字段类型变长?我需要这种方式来避免过多的映射。
最佳答案
如所述 here您不能使用基于点的字段作为唯一键。
相反,您可以使用 string
类型。
关于solr - id 字段为长类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48644438/