lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: Could positions/payloads in SegmentMerger be copied directly?
Date Fri, 19 Sep 2008 15:05:29 GMT

Not quite, because how positions are encoded depends on whether any  
payload appeared in that segment.

However, if 1) the input is a SegmentReader (since in general we can  
merge any IndexReader), and 2) its format is "congruent" with the  
format we are writing (ie both don't or do use the payloads format),  
which ought to be true the vast majority of the time, then I think we  
could simply copy bytes.  Since the next TermInfo tells us the  
proxPointer where it begins, we know exactly how many bytes to copy.   
I think this'd be a nice optimization!

Mike

Paul Elschot wrote:

>
> I'm looking at the for loop in SegmentMerger.java at line 666,
> which completely interprets the input positions/payloads for
> an input term at a document.
>
> The positions/payloads don't change when they merged, is that correct?
> I'm wondering whether this loop could be replaced by a direct copy  
> from
> the input postings to proxOutput.
>
> Regards,
> Paul Elschot
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>


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