solr - id 字段为长类型

标签 solr lucene

我正在尝试将 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/

相关文章:

java - Solr 使用自定义过滤器找不到 BaseTokenFilterFactory

java - Lucene 多值字段 - 将 TextField 与 StringField 混合

java - 与 lucene 索引一起使用的最佳跨语言分析器

ruby - 太阳黑子/Solr : non-alphabetical characters

java - 在最短的时间内合并 60GB 和 10GB 的 solr 索引的最佳方法?

internet-explorer - Apache Solr 4.0 Admin UI 在 MSIE 下不工作

apache - 在 localhost 中尝试 solr 时出错

Lucene按笔画/部首对汉字进行排序

Azure 搜索 - 在 "contains"等单词中查找匹配项

elasticsearch - Elastic Search - 按索引聚合分组