[英]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.