简体   繁体   English

一次将多个文件索引到一个solr文档中

[英]Indexing multiple files at once into one solr document

I am indexing some course data(id, name, summary) along with attachments associates with these courses. 我正在为一些课程数据(id,名称,摘要)以及与这些课程相关的附件编制索引。 I am using Extract RequestHandler to index docs by passing literal fields. 我正在使用Extract RequestHandler通过传递文字字段来索引文档。

now there are three conditions while indexing. 现在索引时有三个条件。

  1. A course may have multiple attachments. 一门课程可能有多个附件。
  2. No attachments 没有附件
  3. A course may have exact one attachment. 一门课程可能只有一个附件。

looking over the issue. 寻找问题。 Solr-php-client Extract method doesn't seems to be useful. Solr-php-client提取方法似乎没有用。 So my question is 所以我的问题是

  1. how to index these binary files along with course data(one solr document) ? 如何索引这些二进制文件以及课程数据(一个Solr文档)?
  2. how to map multiple docs/pdf with unique course id ? 如何使用唯一的课程ID映射多个docs / pdf?

Thanks :) 谢谢 :)

Solr API did not allow attaching multiple files with a single Solr document. Solr API不允许使用单个Solr文档附加多个文件。
For our project, we had zip the multiple files into a single attachment which was attached with the Solr document. 对于我们的项目,我们已经将多个文件压缩到一个单独的附件中,该附件随Solr文档一起附加。
You can also index these multiple documents as individual Solr Documents having the same Course Id and use the Field Collapsing (Grouping) feature to display a Single course with the matches across attachments. 您也可以将多个文档作为具有相同课程ID的单个Solr文档建立索引,并使用字段折叠(分组)功能显示单个课程,其中包含跨附件的匹配项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM