知识点
相关文章
更多最近更新
更多Solr Document [null] missing required field: id 的原因
2019-03-27 00:23|来源: 网路
在solr建立索引的时候,如果你提交的doc中没有 id 这个Field,结果Solr在建立索引时候出现如下错误:
- org.apache.solr.common.SolrException: Document [null] missing required field: id
主要是因为Solr 的solrconfig配置文件中定义了<uniqueKey>id</uniqueKey>,默认了ID 是唯一的。如果你的索引字段不需要ID,就可以把这个改掉.
- <uniqueKey>kwid</uniqueKey>
并将id字段里的required="true"属相,添加到kwid字段。
- <field name="kwid" type="string" indexed="true" stored="true" required="true"/>
本文出自 “兄弟无间” 博客,请务必保留此出处http://llwbrothers.blog.51cto.com/2360705/867477
转自:http://llwbrothers.blog.51cto.com/2360705/867477
相关问答
更多-
您可能错过了schema.xml文件中的以下条目
这里id类型可以是int ... -
SolrNet异常:文档缺少必需的uniqueKey字段:id(SolrNet Exception: Document is missing mandatory uniqueKey field: id)[2023-05-14]
这是我的错。 我指定了错误的URL来映射核心。 所以,我改变了 Startup.Init("http://localhost:8888/solr/#/mytestcore"); 至 Startup.Init ("http://localhost:8888/solr/mytestcore"); 删除了URL中的额外# 。 It was my mistake. I've specified wrong URL to map with core. So, I changed ... -
如何为solr模式定义文档级别和数据级别字段(How to define a document level and data level field for a solr schema)[2023-01-01]
在Solr中,将schema.xml想象为数据库表。 为了保持行的唯一性,我们在其中有一个主键列。 通常喜欢id列,其中包含唯一值。 当您在solr中索引文档时,例如我的案例中的csv文件,其中包含列。 id列必须是唯一的,不能有空行。 有很多方法可以创建独特的字符串,但仅仅是因为我使用了格式file_name_1 ...(有一个填充系列,如1,2,3 ...)。 这是在solr中指定记录唯一性的唯一方法。 你不能拥有文档级别的唯一性意味着在索引时无法提供唯一的密钥。 因此,在schema.xml中,您有一 ... -
Solr - 缺少必需的字段(Solr - Missing Required Field)[2022-03-05]
出于某种原因,Solr不喜欢字段名称上的“Id”后缀。 当我将“documentId”重命名为“document”时,我没有任何错误。 它在“testId”上也失败了,但是当我改名为“test”时工作。 有谁知道为什么“ID”字段名称后缀会导致solr始终报告缺少必填字段,即使传递一个值? For some reason, Solr doesn't like the "Id" suffix on field names. When I rename "documentId" to "document", I ... -
您可以删除schema.xml文件顶部声明为id的uniqueKey字段。 还要从id字段中删除required = true属性。 使用任何其他字段作为您的文档所具有的唯一键。 You can just remove uniqueKey field that is declared as id on the top of schema.xml file . Also remove the required=true attribute from id field . Use any other field ...
-
SolrException:Document [null]缺少必填字段:id(SolrException: Document [null] missing required field: id)[2022-05-29]
你说你添加了几个字段(据说是示例模式),但你没有提到已经存在的字段发生了什么。 我猜你在那里留下了先前存在的字段,这意味着id仍然是必填字段(请参阅示例模式中的这里 ),因此您看到错误。 You say you added a few fields (supposedly to the sample schema), but you don't mention what happened to the fields that were already there. I'm guessing you left ... -
使用Solr索引嵌套数据(Indexing nested data with Solr)[2022-09-06]
发生这种情况导致需要将字段应用于父文档的事实。 因此,您的父母文档也需要拥有这些字段,即使这些字段对孩子有意义也是如此。 相同的问题将显示“id”字段...只需删除所需的属性即可。 编辑:保持所需的attr,添加此(仅适用于此处显示的dept_no,对于其余部分也是如此):Solr:当字段没有丢失时“缺少必填字段”错误?(Solr: “missing required field” error when the field is not missing?)[2021-11-19]
必填字段必须标记为已建立索引或已存储。 您可以删除这两个字段的必需属性,并将索引和存储为false。 由于文本字段只能搜索,因此您可以将字段类型设置为普通字符串,而不对其他字段进行任何分析。 Required Field must be marked as indexed or stored. You can remove the required attribute for both the fields and have both the indexed and stored as false. As ...无法添加到Solr索引 - 文档缺少uniqueKey字段?(Can't add to Solr index - document is missing uniqueKey field?)[2023-11-21]
好吧,这有点令人尴尬。 我的网站调用一个执行实际索引的Web服务。 我已将主Web服务项目dll复制到实时服务器文件夹,但没有一个具有更新的模式字段的帮助程序库。 Ok, this is a bit embarassing. My website calls a web service that does the actual indexing. I had copied the main web service project dll to the live server folder, but not ...Solr索引中缺少Id字段(Missing Id field in Solr index)[2022-04-10]
理查德回答说, _group有一个_group字段。 如果您希望将其自动转换为ID对象,您可以使用: [TypeConverter(typeof (IndexFieldIDValueConverter))] [IndexField("_group")] public virtual ID ItemId { get; set; } 请记住,如果您有多个版本或语言版本, _group字段将不够,因为将有多个具有相同_group (id)的文档。 在这种情况下,您可能想要使用UniqueId - 它包含有关id ...