簡體   English   中英

將索引從Solr導出到文件,其中字段對於FieldCache是​​非法的

[英]Exporting index from Solr to a file, with fields illegal for FieldCache

我正在嘗試將Solr索引導出到JSON文件。 但是,在我關心的2個字段中,其中一個(字段A )是multivalued ,另一個(字段Bneither indexed nor has doc values (此字段可能缺少架構)。 兩者都導致錯誤,指出can not use FieldCache on a field which is ...

這些字段的模式位於遠程服務器上,不應更改。 那么是否有可能通過這些字段導出索引? 謝謝!

PS。如果可能,我也想fl這2場,因為他們都是我所需要的。

在這種情況下,你可能想自己寫一個導出腳本, 使用光標標記來加快檢索(使用/導出功能,該領域啟用docValues)。

有幾種語言的示例可用於提取光標標記頁上的所有文檔,並且幾乎可以直接將它們應用到結果集中(您必須自己編寫JSON才能應用)。

 SolrQuery q = (new SolrQuery(some_query)).setRows(r).setSort(SortClause.asc("id")); String cursorMark = CursorMarkParams.CURSOR_MARK_START; boolean done = false; while (! done) { q.set(CursorMarkParams.CURSOR_MARK_PARAM, cursorMark); QueryResponse rsp = solrServer.query(q); String nextCursorMark = rsp.getNextCursorMark(); doCustomProcessingOfResults(rsp); if (cursorMark.equals(nextCursorMark)) { done = true; } cursorMark = nextCursorMark; } 

確保使用較大的r值,以減少往返次數。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM