lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nick Pellow (JIRA)" <j...@apache.org>
Subject [jira] Created: (LUCENE-2801) getOffsetGap should not be called for non-anaylyzed fields
Date Mon, 06 Dec 2010 10:34:11 GMT
getOffsetGap should not be called for non-anaylyzed fields
----------------------------------------------------------

                 Key: LUCENE-2801
                 URL: https://issues.apache.org/jira/browse/LUCENE-2801
             Project: Lucene - Java
          Issue Type: Bug
          Components: Analysis
    Affects Versions: 3.0.3
            Reporter: Nick Pellow


from: LUCENE-2235

Since Lucene 3.0.3, when a PerFieldAnalyzerWrapper is constructed with a null defaultAnalyzer
it will NPE when DocInverterPerField calls:
{code}
 fieldState.offset += docState.analyzer.getOffsetGap(field);
{code}
This block should first check that the field is analyzed, or the javadoc on PerFieldAnalyzerWrapper
could mention that a null defaultAnalyzer is disallowed.

Also, the main reason for checking for isAnalyzed, from Uwe Schindler in LUCENE-2235
{quote}
One problem coming from not checking for "analyzed" is this:
You add a field indexed and it gets analyzed by PFAW - After that you add the same field name
stored-only (which is perfectly legal and often used, e.g. when the stored value is binary
or in some other format and does not correspond to the indexed text), the positionIncrement
is increased. After that you again add another instance of the same field as indexed-only,
which also increases posIncr. So you have 2 times the gap between both indexed sub-fields.
This is definitely wrong.

{quote}

-- 
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message