Solr 1.4 中带有子字段的自定义字段
有谁知道如何在 solr 1.4 中创建自定义字段?我需要创建一个包含相同类型子值的字段,例如 3 个字符串。
问题是这样的:假设我想在模式中声明一个“image”字段,它有 3 个子字段(字符串),如“path”、“title”、“thumb_path”。
有什么想法吗?
我知道在 solr 1.5 中可能会有 LatLon 对象的概念,包含纬度和经度的 2 个值(双精度)。你见过类似的东西吗?
卢卡
does anyone know how to create a custom field in solr 1.4? I need to create a field containing sub values of the same type, say 3 strings.
The problem is abt something like this: suppose i want to declare in the schema an "image" field, which has 3 sub-fields (strings) like "path", "title", "thumb_path".
Any ideas?
I know in solr 1.5 there will be probably the concept of LatLon object, to contain the 2 values -doubles- of latitude and longitude. Have you seen something like that?
Luca
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您应该考虑在 SOLR 索引中创建“图像”文档的索引。
每个图像“doc”都将具有以下字段:
其中 [gallery] 是一个多值字段(假设图像可以出现在多个图库中)
构建图库页面,请运行查询“gallery: foo”,然后迭代图像列表,从字段填充 HTML 元素:标题、路径等。
注意:SOLR 并不限制您在其索引中使用单一文档类型(是否最佳实践是另一回事) 。因此您也可以索引其他非图像文档。在这种情况下,建议使用“doc_type”之类的字段,以便您可以将搜索限制为该类型
Sounds like you should consider creating an index of "image" documents in your SOLR index.
Each image "doc" would have the fields:
where [gallery] is a multi-value field (assuming images can appear in more than one gallery)
To construct a gallery page, you run the query "gallery:foo" and then iterate over the list of images, populating the HTML elements from the fields: title, path, etc.
Note: SOLR does not limit you to having a single document type in its index (whether its best practice is another matter). So you could also index other non-image documents as well. In this case its advisable to have a field like "doc_type" so you can limit searches to that type