lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley (JIRA)" <>
Subject [jira] Updated: (LUCENE-374) You cannot sort on fields that don't exist
Date Wed, 28 Sep 2005 02:33:50 GMT
     [ ]

Yonik Seeley updated LUCENE-374:

    Attachment: sort.diff

Attaching latest version.

I looked into TestSort to add some tests for this, and was surprised to see some tests that
should have covered it: testEmptyIndex()
It turns out FieldCacheImpl special-cased an empty index with "if (retArray.length > 0)

After removing only  those special-case checks from FieldCacheImpl, the tests fail (demonstrating
the problem).
After applying my full patch, all tests pass again.

This latest diff is a little hard to read because indentation changed due to the removal of
the "if" test, but that's only difference between this and the last diff.

> You cannot sort on fields that don't exist
> ------------------------------------------
>          Key: LUCENE-374
>          URL:
>      Project: Lucene - Java
>         Type: Bug
>   Components: Search
>     Versions: CVS Nightly - Specify date in submission
>  Environment: Operating System: other
> Platform: Other
>     Reporter: Daniel Naber
>     Assignee: Lucene Developers
>  Attachments: sort.diff, sort.diff, sort.diff
> While it's possible to search for fields that don't exist (you'll get 0 hits),  
> you'll get an exception if you try to sort by a field that has no values. The  
> exception is this:  
> if (termEnum.term() == null) {  
>   throw new RuntimeException ("no terms in field " + field);  
> }  
> I'll attach a change suggested by Yonik Seeley that removes this exception. 
> Also, the if-condition above is incomplete anyway, so currently the exception 
> is not always thrown (as termEnum .term() might well be != null but point to a 
> term in a different field already)

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message