lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Busch (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-761) Clone proxStream lazily in SegmentTermPositions
Date Sat, 10 Mar 2007 20:06:09 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479876
] 

Michael Busch commented on LUCENE-761:
--------------------------------------

Grant,

you're right, it is a simple change to clone the stream lazily. And I think I will do that
for now. The benefit then is, that it won't be more expensive anymore to use a SegmentTermPosition
object instead of a SegmentTermDocs in scorers. 

However, there might be one drawback. SegmentTermDocs implements the method 
   int read(final int[] docs, final int[] freqs)
which is used by TermScorer for better performance. SegmentTermPositions overwrites this method
and just throws a UnsupportedOperationException. This just becomes a problem if we want to
make TermScorer extendable, so that subclasses can make use of payloads.... But actually I
don't see much benefit in extending TermScorer over just extending Scorer for such a use case.
What do you think?

> Clone proxStream lazily in SegmentTermPositions
> -----------------------------------------------
>
>                 Key: LUCENE-761
>                 URL: https://issues.apache.org/jira/browse/LUCENE-761
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>            Reporter: Michael Busch
>         Assigned To: Michael Busch
>            Priority: Minor
>
> In SegmentTermPositions the proxStream should be cloned lazily, i. e. at the first time
nextPosition() is called. Then the initialization costs of TermPositions are not higher anymore
compared to TermDocs and thus there is no reason anymore for Scorers to use TermDocs instead
of TermPositions. In fact, all Scorers should use TermPositions, because custom subclasses
of existing scorers might want to access payloads, which is only possible via TermPositions.
We could further merge SegmentTermDocs and SegmentTermPositions into one class and deprecate
the interface TermDocs.
> I'm going to attach a patch once the payloads feature (LUCENE-755) is committed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
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