You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by David Kaelbling <dk...@blackducksoftware.com> on 2009/09/10 19:52:32 UTC
Using attributes after end of stream
Hi,
After incrementToken() returns false, what are attribute getters supposed to return? I thought that any such calls would be erroneous (the equivalent of NullPointerExceptions), but org.apache.lucene.index.DocInverterPerField.processFields() makes just such a call at line 194.
Thanks,
David
--
David Kaelbling
Senior Software Engineer
Black Duck Software, Inc.
dkaelbling@blackducksoftware.com
T +1.781.810.2041
F +1.781.891.5145
http://www.blackducksoftware.com
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: Using attributes after end of stream
Posted by Michael McCandless <lu...@mikemccandless.com>.
I think it depends on the attribute?
In that case (a call to offsetAttribute.endOffset(), after
TokenStream.end() has been called), that method returns the final
offset increment. This is necessary so multi-valued fields keep the
right offsets (see https://issues.apache.org/jira/browse/LUCENE-1448
for details of what led to this).
Mike
On Thu, Sep 10, 2009 at 1:52 PM, David Kaelbling
<dk...@blackducksoftware.com> wrote:
> Hi,
>
> After incrementToken() returns false, what are attribute getters supposed to return? I thought that any such calls would be erroneous (the equivalent of NullPointerExceptions), but org.apache.lucene.index.DocInverterPerField.processFields() makes just such a call at line 194.
>
> Thanks,
> David
>
> --
> David Kaelbling
> Senior Software Engineer
> Black Duck Software, Inc.
>
> dkaelbling@blackducksoftware.com
> T +1.781.810.2041
> F +1.781.891.5145
>
> http://www.blackducksoftware.com
> ---------------------------------------------------------------------
> 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