SOLR 未定义字段长度
使用 SOLR 和 DataImportHandler,我们已经为数据库建立了索引。数据库有一个字段,其中包含行的串联属性数据。我们在 data-config.xml 文件中使用转换器来读取该字段并将其拆分为多个动态字段。
我们使用这些数据作为构面进行搜索。
我们可以将某些字段作为分面进行搜索,并且效果非常好,但是,某些字段无法进行分面搜索(例如 fq=attr_fieldname:"facetval")。搜索时,它们返回“HTTP Status 400 - 未定义字段类型”或“HTTP Status 400 - 未定义字段长度”
我们可以看到在查看模式浏览器时创建了动态字段,因此不存在是否存在字段名称正确。
在我们的schema.xml中,动态字段被定义为不允许多值的字符串类型。
关于造成这种情况的原因,或者我们可以采取哪些措施来预防它,有什么想法吗?
谢谢!
更新 - - 这是我们正在使用的动态字段定义:
<dynamicField name="attr_*" type="string" indexed="true" stored="false" multiValued="false"/>
更新 2--- 有人知道由动态字段引起的问题,该字段最终会被命名为“attr_type”或“attr_length”吗? 根据其中一条评论,有人建议我们可能发送“长度”或“类型”作为字段名称。我们没有这样做,但我们正在发送“attr_length”或“attr_type”
Using SOLR and the DataImportHandler, we have indexed our database. The database has a field that contains concatenated property data for the row. We use a transformer in our data-config.xml file to read that field and split it into several dynamic fields.
We use this data to search against as facets.
We can search some of the fields as facets and it works perfectly, however, some of the fields cannot do a facet search (e.g. fq=attr_fieldname:"facetval"). When searching, they return "HTTP Status 400 - undefined field Type" or "HTTP Status 400 - undefined field Length"
We can see the dynamic fields are created when viewing the schema browser, so there isn't a question on whether or not the field name is correct.
In our schema.xml, the dynamic field is defined as a string type that does not allow multivalued.
Any ideas about what is causing this, or what we can do to prevent it?
Thanks!
UPDATE---
Here is the dynamic field definition that we're using:
<dynamicField name="attr_*" type="string" indexed="true" stored="false" multiValued="false"/>
UPDATE 2---
Is anyone aware of an issue caused by a dynamic field that would end up being named "attr_type" or "attr_length"?
Based on one of the comments, it was suggested that maybe we were sending "length" or "type" as a field name. We aren't doing that, but we are sending "attr_length" or "attr_type"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论