any good idea for loading fields into memory?

2012-06-20 Thread Li Li
hi all I need to return certain fields of all matched documents quickly. I am now using Document.get(field), but the performance is not well enough. Originally I use HashMap to store these fields. it's much faster but I have to maintain two storage systems. Now I am reconstructing this

Re: any good idea for loading fields into memory?

2012-06-20 Thread Danil ŢORIN
I think you are looking for FieldCache. I'm not sure the current status in 4x, but it worked in 2.9/3.x. Basically it's an array, so access is quite straight forward, and the best part IndexReader manage those for you, so on reopen only new segments are read. Small catch is that FiledCaches are

Re: any good idea for loading fields into memory?

2012-06-20 Thread Li Li
thanks, l will try it 在 2012-6-20 晚上8:59,Danil ŢORIN torin...@gmail.com写道: I think you are looking for FieldCache. I'm not sure the current status in 4x, but it worked in 2.9/3.x. Basically it's an array, so access is quite straight forward, and the best part IndexReader manage those for

Re: any good idea for loading fields into memory?

2012-06-20 Thread Li Li
but as l can remember, in 2.9.x FieldCache can only apply to indexed but not analyzed fields. 在 2012-6-20 晚上8:59,Danil ŢORIN torin...@gmail.com写道: I think you are looking for FieldCache. I'm not sure the current status in 4x, but it worked in 2.9/3.x. Basically it's an array, so access is

Re: any good idea for loading fields into memory?

2012-06-20 Thread Michael McCandless
Right, the field must have a single token for FieldCache. But if you are on 4.x you can use DocTermOrds (FieldCache.getDocTermOrds) which allows for multiple tokens per field. Mike McCandless http://blog.mikemccandless.com On Wed, Jun 20, 2012 at 9:47 AM, Li Li fancye...@gmail.com wrote: but