[ https://issues.apache.org/jira/browse/LUCENE-459?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shai Erera closed LUCENE-459. ----------------------------- Resolution: Not A Problem Assignee: (was: Lucene Developers) I created an index with one empty document, ran a search with MatchAllDocsQuery and a Sort on a field that doesn't exist, and the search returned 1 result, no RuntimeExceptions thrown. Since this issue is inactive for a long time, and I don't seem to be able to reproduce it, I'm closing it. > Warnings needed for sorting on non existant or non indexed fields > ----------------------------------------------------------------- > > Key: LUCENE-459 > URL: https://issues.apache.org/jira/browse/LUCENE-459 > Project: Lucene - Java > Issue Type: Bug > Components: Search > Affects Versions: CVS Nightly - Specify date in submission > Environment: Operating System: other > Platform: Other > Reporter: Daniel Naber > Priority: Minor > > 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. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org