lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <paul.elsc...@xs4all.nl>
Subject Re: [Performance] Streaming main memory indexing of single strings
Date Mon, 02 May 2005 22:10:47 GMT
On Monday 02 May 2005 23:38, Wolfgang Hoschek wrote:
> > Yes, the svn trunk uses skipTo more often than 1.4.3.
> >
> > However, your implementation of skipTo() needs some improvement.
> > See the javadoc of skipTo of class Scorer:
> >
> > http://lucene.apache.org/java/docs/api/org/apache/lucene/search/ 
> > Scorer.html#skipTo(int)
> 
> What's wrong with the version I sent? Remeber that there can be at most  
> one document in a MemoryIndex. So the "target" parameter can safely be  
> ignored, as far as I can see.

Correct, I did not realize that there is only a single doc in the index.

> 
> >
> > In case the underlying scorers provide skipTo() it's even better to  
> > use that.
> >
> 
> The version I sent returns in O(1), if performance was your concern. Or  
> did you mean something else?

Since 0 is the only document number in the index, a

return target == 0;

might be nice for skipTo(). It doesn't really help performance, though,
and the next() works just as well.

Regards,
Paul Elschot.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message