lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: indexing help
Date Thu, 08 Jul 2004 21:08:38 GMT
John Wang wrote:
> Just for my education, can you maybe elaborate on using the
> "implement an IndexReader that delivers a
> synthetic index" approach?

IndexReader is an abstract class.  It has few data fields, and few 
non-static methods that are not implemented in terms of abstract 
methods.  So, in effect, it is an interface.

When Lucene indexes a token stream it creates a single-document index 
that is then merged with other single- and multi-document indexes to 
form an index that is searched.  You could bypass the first step of this 
(indexing a token stream) by instead directly implementing all of 
IndexReader's abstract methods to return the same thing as the 
single-document index that Lucene would create.  This would be 
marginally faster, as no Token objects would be created at all.  But, 
since IndexReader has a lot of abstract methods, it would be a lot of 
work.  I didn't really mean it as a practical suggestion.

Doug

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


Mime
View raw message