2
我試圖在Solr的索引PDF文件,但看起來像,同時將文本轉換爲/索引問題UTF-8字符得到改變。搜索與非英語
例如下面突出顯示的文本:
轉換爲:
搜索適用於以後的關鍵字不是原詞。據我所知,這是在索引編制之前將PDF文本轉換爲UTF-8時發生的。下面
供參考是索引代碼:
String solrUrlString = "http://localhost:8983/solr/example";
SolrClient solr = new HttpSolrClient(solrUrlString);
ContentStreamUpdateRequest up = new ContentStreamUpdateRequest("/update/extract");
up.addFile(new File(filepage.getabsPath()), "application/pdf");
up.setParam("literal.id", filepage.getId());
up.setParam("uprefix", "attr_");
up.setParam("fmap.content", "attr_content");
up.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true);
solr.request(up);