You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Jaap Taal (JIRA)" <ji...@apache.org> on 2011/02/11 14:38:57 UTC

[jira] Created: (LUCENENET-394) AnonymousClassScoreDocComparator throws nullreferenceexception

AnonymousClassScoreDocComparator throws nullreferenceexception
--------------------------------------------------------------

                 Key: LUCENENET-394
                 URL: https://issues.apache.org/jira/browse/LUCENENET-394
             Project: Lucene.Net
          Issue Type: Bug
         Environment: Lucene.NET 2.4.0.2
            Reporter: Jaap Taal
            Priority: Blocker


I've added a field to my index (Store.NO, Index.UN_TOKENIZED), I've updated a couple of my documents and I'm now sorting on it (after I collected document id's in a HitCollector). My search results in some documents that consist of document with the field and without.

I use a simple implementation of SortComparator which implements GetComparable by just returning the passed termtext.

I've set a breakpoint at my GetComparable method and I see the correct values (the method is NOT called for documents that don't have the field as a value).


When SortComparer.Compare is called, a NullReferenceException occurs in:

{code}
public virtual int Compare(ScoreDoc i, ScoreDoc j)
{
    return this.cachedValues[i.doc].CompareTo(this.cachedValues[j.doc]);
}
{code}

The expression this.cachedValues[i.doc] is null.



Is this a limitation of SortComparer (and its AnonymousClassScoreDocComparator) that all documents in a searchresult need to have a value for the field??

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (LUCENENET-394) AnonymousClassScoreDocComparator throws nullreferenceexception

Posted by "Scott Lombard (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-394?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Lombard updated LUCENENET-394:
------------------------------------

    Priority: Minor  (was: Blocker)

> AnonymousClassScoreDocComparator throws nullreferenceexception
> --------------------------------------------------------------
>
>                 Key: LUCENENET-394
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-394
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: Lucene.NET 2.4.0.2
>            Reporter: Jaap Taal
>            Priority: Minor
>              Labels: exception, fieldcache, sort,
>
> I've added a field to my index (Store.NO, Index.UN_TOKENIZED), I've updated a couple of my documents and I'm now sorting on it (after I collected document id's in a HitCollector). My search results in some documents that consist of document with the field and without.
> I use a simple implementation of SortComparator which implements GetComparable by just returning the passed termtext.
> I've set a breakpoint at my GetComparable method and I see the correct values (the method is NOT called for documents that don't have the field as a value).
> When SortComparer.Compare is called, a NullReferenceException occurs in:
> {code}
> public virtual int Compare(ScoreDoc i, ScoreDoc j)
> {
>     return this.cachedValues[i.doc].CompareTo(this.cachedValues[j.doc]);
> }
> {code}
> The expression this.cachedValues[i.doc] is null.
> Is this a limitation of SortComparer (and its AnonymousClassScoreDocComparator) that all documents in a searchresult need to have a value for the field??

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (LUCENENET-394) AnonymousClassScoreDocComparator throws nullreferenceexception

Posted by "Digy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993738#comment-12993738 ] 

Digy commented on LUCENENET-394:
--------------------------------

First of all, JIRA is not the right place to ask question. It is an issue/bug tracking system. Please use mailing lists for your questions.
Second, I was not able to regenerate your case. A *small and self-contained* test case would be useful.
Third, please upgrade to 2.9.2 and make your test against it. Because I don't think that a fix for v2.4 will be available.

DIGY

> AnonymousClassScoreDocComparator throws nullreferenceexception
> --------------------------------------------------------------
>
>                 Key: LUCENENET-394
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-394
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: Lucene.NET 2.4.0.2
>            Reporter: Jaap Taal
>            Priority: Blocker
>              Labels: exception, fieldcache, sort,
>
> I've added a field to my index (Store.NO, Index.UN_TOKENIZED), I've updated a couple of my documents and I'm now sorting on it (after I collected document id's in a HitCollector). My search results in some documents that consist of document with the field and without.
> I use a simple implementation of SortComparator which implements GetComparable by just returning the passed termtext.
> I've set a breakpoint at my GetComparable method and I see the correct values (the method is NOT called for documents that don't have the field as a value).
> When SortComparer.Compare is called, a NullReferenceException occurs in:
> {code}
> public virtual int Compare(ScoreDoc i, ScoreDoc j)
> {
>     return this.cachedValues[i.doc].CompareTo(this.cachedValues[j.doc]);
> }
> {code}
> The expression this.cachedValues[i.doc] is null.
> Is this a limitation of SortComparer (and its AnonymousClassScoreDocComparator) that all documents in a searchresult need to have a value for the field??

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (LUCENENET-394) AnonymousClassScoreDocComparator throws nullreferenceexception

Posted by "Scott Lombard (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-394?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Lombard resolved LUCENENET-394.
-------------------------------------

    Resolution: Won't Fix
      Assignee: Scott Lombard

I changed the priority on this item to minor.  I am going to wait a few days before closing it to get a feel for what the community wants to do about bugs pre 2.9.2.  

> AnonymousClassScoreDocComparator throws nullreferenceexception
> --------------------------------------------------------------
>
>                 Key: LUCENENET-394
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-394
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: Lucene.NET 2.4.0.2
>            Reporter: Jaap Taal
>            Assignee: Scott Lombard
>            Priority: Minor
>              Labels: exception, fieldcache, sort,
>
> I've added a field to my index (Store.NO, Index.UN_TOKENIZED), I've updated a couple of my documents and I'm now sorting on it (after I collected document id's in a HitCollector). My search results in some documents that consist of document with the field and without.
> I use a simple implementation of SortComparator which implements GetComparable by just returning the passed termtext.
> I've set a breakpoint at my GetComparable method and I see the correct values (the method is NOT called for documents that don't have the field as a value).
> When SortComparer.Compare is called, a NullReferenceException occurs in:
> {code}
> public virtual int Compare(ScoreDoc i, ScoreDoc j)
> {
>     return this.cachedValues[i.doc].CompareTo(this.cachedValues[j.doc]);
> }
> {code}
> The expression this.cachedValues[i.doc] is null.
> Is this a limitation of SortComparer (and its AnonymousClassScoreDocComparator) that all documents in a searchresult need to have a value for the field??

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira