RE: How to read values of a field efficiently

2007-08-21 Thread Ard Schrijvers
> > > > I am deeply hurt by your distrust. > > > > :-) > > Shame on me :-$ haha :-) >

RE: How to read values of a field efficiently

2007-08-21 Thread Martin Grotzke
On Tue, 2007-08-21 at 11:52 +0200, Ard Schrijvers wrote: > > > you're missing the key piece that Ard alluded to ... the > > there is one > > > ordere list of all terms stored in the index ... a TermEnum lets you > > > iterate over this ordered list, and the > > IndexReader.terms(Term) method > >

RE: How to read values of a field efficiently

2007-08-21 Thread Ard Schrijvers
> > you're missing the key piece that Ard alluded to ... the > there is one > > ordere list of all terms stored in the index ... a TermEnum lets you > > iterate over this ordered list, and the > IndexReader.terms(Term) method > > lets you efficiently start at an arbitrary term. if you are only

RE: How to read values of a field efficiently

2007-08-21 Thread Martin Grotzke
On Mon, 2007-08-20 at 11:41 -0700, Chris Hostetter wrote: > : > TermEnum terms = searcher.getReader().terms(new Term(field, "")); > : > while (terms.term() != null && terms.term().field() == field){ > : > //do things > : > terms.next(); > : > } > > : while( te.next() )

RE: How to read values of a field efficiently

2007-08-20 Thread Chris Hostetter
: > TermEnum terms = searcher.getReader().terms(new Term(field, "")); : > while (terms.term() != null && terms.term().field() == field){ : > //do things : > terms.next(); : > } : while( te.next() ) { : final Term term = te.term(); you're missing the ke

RE: How to read values of a field efficiently

2007-08-20 Thread Martin Grotzke
On Sun, 2007-08-19 at 21:39 +0200, Ard Schrijvers wrote: > > On Mon, 2007-07-30 at 00:30 -0700, Chris Hostetter wrote: > > > : Is it possible to get the values from the ValueSource (or from > > > : getFieldCacheCounts) sorted by its natural order (from lowest to > > > : highest values)? > > > > >

RE: How to read values of a field efficiently

2007-08-19 Thread Ard Schrijvers
Hello, > > On Mon, 2007-07-30 at 00:30 -0700, Chris Hostetter wrote: > > : Is it possible to get the values from the ValueSource (or from > > : getFieldCacheCounts) sorted by its natural order (from lowest to > > : highest values)? > > > > well, an inverted term index is already a data structure

Re: How to read values of a field efficiently

2007-08-19 Thread Martin Grotzke
On Mon, 2007-07-30 at 00:30 -0700, Chris Hostetter wrote: > : Is it possible to get the values from the ValueSource (or from > : getFieldCacheCounts) sorted by its natural order (from lowest to > : highest values)? > > well, an inverted term index is already a data structure listing terms > from l

Re: How to read values of a field efficiently

2007-07-31 Thread Martin Grotzke
On Mon, 2007-07-30 at 00:30 -0700, Chris Hostetter wrote: > : Is it possible to get the values from the ValueSource (or from > : getFieldCacheCounts) sorted by its natural order (from lowest to > : highest values)? > > well, an inverted term index is already a data structure listing terms > from l

Re: How to read values of a field efficiently

2007-07-30 Thread Chris Hostetter
: Is it possible to get the values from the ValueSource (or from : getFieldCacheCounts) sorted by its natural order (from lowest to : highest values)? well, an inverted term index is already a data structure listing terms from lowest to highest and the associated documents -- so if you want to it

Re: How to read values of a field efficiently

2007-07-24 Thread Martin Grotzke
On Mon, 2007-07-23 at 23:32 -0700, Chris Hostetter wrote: > : This part (reading field values) takes fairly long compared > : to the other fields (that use getFacetTermEnumCounts or > : getFieldCacheCounts as implemented in SimpleFacets), so that > : I asume that there is potential for optimization

Re: How to read values of a field efficiently

2007-07-23 Thread Chris Hostetter
: This part (reading field values) takes fairly long compared : to the other fields (that use getFacetTermEnumCounts or : getFieldCacheCounts as implemented in SimpleFacets), so that : I asume that there is potential for optimization. : : Fairly long: getFieldCacheCounts for the cat field takes ~7

How to read values of a field efficiently

2007-07-21 Thread Martin Grotzke
Hi, I have a custom Facet implementation that extends SimpleFacets and overrides getTermCounts( String field ). For the price field I calculate available ranges, for this I have to read the values for this field. Right this looks like this: public NamedList getTermCounts( final String field