- 原文:http://wiki.apache.org/lucene-java/ImproveIndexingSpeed
- 導航:Lucene-java Wiki-》1 Overview-》1.1 Informational-》 1.1.1BasicsOfPerformance-》1.1.1.4 ImproveIndexingSpeed
- 注意:“ 紅色 ”,表示不知道、不確定怎麼翻譯。 “ 藍色”自己的描述。
- 狀態:完成
8.以同樣的順序在Document中添加fields
原文 寫道
Always add fields in the same order to your Document, when using stored fields or term vectors
Lucene's merging has an optimization whereby stored fields and term vectors can be bulk-byte-copied, but the optimization only applies if the field name -> number mapping is the same across segments. Future Lucene versions may attempt to assign the same mapping automatically (see LUCENE-1737), but until then the only way to get the same mapping is to always add the same fields in the same order to each document you index.
以同樣的順序在Document中添加fields,大家平時就是這麼做的。Lucene在合併索引的時候有一個優化功能,即可以根據field和term vectors實現批量字節拷貝,但該優化只有在 name->number映射在所有segments都相同的情況下方可實現。未來的lucene版本可能將會實現自動映射(參看),但目前爲止,只有“以同樣的順序在Document中添加fields”這一種方式來獲得一樣的映射。
9.在分析器Analyzers 中複用(單例模式)Token 實例
在分析器Analyzers 中複用(單例模式)Token 實例。對於需要建立索引的Field,分析器Analyzers會爲其中的沒個term創建一個Token 對象。你可以通過複用Token來降低垃圾回收的消耗。
人家的翻譯:
悲哀啊,我到現在沒用過token,啥情況???
10.用Tokenz中的char[] API代替String API來表示數據
原文 寫道
represent ...as : 把…描繪成 。暈,這都忘記了。
人家的翻譯