[jira] Commented: (LUCENE-2235) implement PerFieldAnalyzerWrapper.getOffsetGap

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[jira] Commented: (LUCENE-2235) implement PerFieldAnalyzerWrapper.getOffsetGap

Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-2235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12967057#action_12967057 ]

Nick Pellow commented on LUCENE-2235:

I just upgraded to 3.0.3 and we started getting NullPointerExceptions coming from PerFieldAnalyzerWrapper.
We have a  PerFieldAnalyzerWrapper that has a null defaultAnalyzer:
private final PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(null);

We add analyzers to all fields that are analyzed. ie: field.isAnalyzed() == true.
getOffsetGap on  PerFieldAnalyzerWrapper is being called, even for these non-analyzed fields. Is this expected behaviour?

Lines 200-203 of DocInverterPerField are:
        if (anyToken)
          fieldState.offset += docState.analyzer.getOffsetGap(field);
        fieldState.boost *= field.getBoost();

Should this be checking that a field is indeed analyzed before calling getOffsetGap ?

> implement PerFieldAnalyzerWrapper.getOffsetGap
> ----------------------------------------------
>                 Key: LUCENE-2235
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2235
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Analysis
>    Affects Versions: 3.0
>         Environment: Any
>            Reporter: Javier Godoy
>            Assignee: Uwe Schindler
>            Priority: Minor
>             Fix For: 2.9.4, 3.0.3, 3.1, 4.0
>         Attachments: LUCENE-2235.patch, PerFieldAnalyzerWrapper.patch
> PerFieldAnalyzerWrapper does not delegates calls to getOffsetGap(Fieldable), instead it returns the default values from the implementation of Analyzer. (Similar to LUCENE-659 "PerFieldAnalyzerWrapper fails to implement getPositionIncrementGap")

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: [hidden email]
For additional commands, e-mail: [hidden email]