[英]Solr Cloud: How to disable document (pdf, office) metadata as fields
我是Solr的新手,并在solr云模式下使用Solr 7.3.1,并尝试在solr中使用contentextraction索引pdf,solr中的Office文档。
我创建了一个收藏
bin\\solr create -c tsindex -s 2 -rf 2
在SolrJ中,我的代码看起来像
public static void main(String[] args) {
System.out.println("Solr Indexer");
final String solrUrl = "http://localhost:8983/solr/tsindex/";
HttpSolrClient solr = new HttpSolrClient.Builder(solrUrl).build();
String filename="C:\\iSampleDocs\\doc-file.doc";
ContentStreamUpdateRequest solrRequest = new ContentStreamUpdateRequest("/update/extract");
try {
solrRequest.addFile(new File(filename), "application/msword");
solrRequest.setParam("litral.ts_ref", "ts-456123");
//solrRequest.setParam("defaultField", "text");
solrRequest.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true);
NamedList<Object> result= solr.request(solrRequest);
System.out.println(result);
} catch (IOException e) {
e.printStackTrace();
}catch ( SolrServerException e) {
e.printStackTrace();
}
}
我遇到多个问题
尽管我已经在Solr Admin UI text_general
字段ts_ref
为text_general
,但此字段完全没有设置。
我的目标是在一个字段中索引包含其元数据的完整文档,然后在另一个系统(例如ts_ref字段)中设置多个引用文件的文件。 但是实际发生的是Solr提取文件的元数据并为每个元数据值创建单独的文件。
我尝试通过bin\\solr config -c tsindex -zkHost localhost:9983 -property update.autoCreateFields -value false
禁用data driven schema functionality
当我取消注释行solrRequest.setParam("defaultField", "text");
从一开始,就没有针对提取的所有元数据的单独字段,但是,一旦我注释了这一行并上传了文件,元数据便会再次位于单独的字段中(即使我再次取消注释)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.