Ps:in our evrioment a document have more than ten field,in a short time,may be have many update. installing a mergedSegmentWarmer on the writer,can you give me a small case, thanks very much!
-----邮件原件----- 发件人: luocanrao [mailto:luocan19826...@sohu.com] 发送时间: 2010年2月27日 19:09 收件人: java-user@lucene.apache.org 主题: 答复: custom FieldCache cost too much time. how can I preload the the custom fieldCache when new segment exits! I set merge factor 4, every five minute I reopen the reader. yes most of the time is very fast. But sometimes it is very slow. For example,when start the program,the first query cosume 10s! So when newly created segment generated,the query cosume more than 1s. Our performance is key point. Sorry ,my English is not good! I hope I can preload custom fieldCache in a another thread,not the query thread. So I will not have performace issue. -----邮件原件----- 发件人: Michael McCandless [mailto:luc...@mikemccandless.com] 发送时间: 2010年2月27日 18:37 收件人: java-user@lucene.apache.org 主题: Re: custom FieldCache cost too much time. how can I preload the the custom fieldCache when new segment exits! How are you opening a new reader? If it's a near-real-time reader (IndexWriter.getReader), or you use IndexReader.reopen, it should only be the newly created segments that have to generate the field cache entry, which most of the time should be fast. If you are already using those APIs and its still not fast enough, then you should just warm the reader before using it (additionally, for a near-real-time reader you should warm newly merged segments by installing a mergedSegmentWarmer on the writer). Mike On Sat, Feb 27, 2010 at 3:35 AM, luocanrao <luocan19826...@sohu.com> wrote: > custom FieldCache cost too much time. > So every first time,reopen the new reader ,it interfere the performance of > search > I hope someone can tell me,how can I preload the the custom fieldCache when > new segment exits! > Thanks again! > > here is source , In FieldComparator.setNextReader method > ((C2CFieldManager)fieldManager).lCommID = > FieldCache.DEFAULT.getLongs(reader, "1",new LongParser(){ > public long parseLong(String documentIDStr) > { > documentIDStr = > documentIDStr.substring(16); > long documentID = > Long.parseLong(documentIDStr,16); > return documentID; > } > > }); > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org