[ https://issues.apache.org/jira/browse/SOLR-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12989499#comment-12989499 ]
Hoss Man commented on SOLR-2339: -------------------------------- I should have mentioned when i attached the patch: the approach i took here was to add a "void checkSortability()" method to SchemaField that tests isMultivalued -- i also moved the "is this field indexed?" check here (it use to be part of QueryParsing.parseSortSpec) and changed all the out of hte box FieldTypes to call this method in their getSortField implementation -- this way we have acommon (documented) hook point where we can add future helper tests for things that don't make sense of in sorting, but it's still up to the FieldType to decide what to do if someone wants to make a really exotic one (RandomSortField for example doesn't even care if it's indexed). If anyone has any better suggestions please chime in. > No error reported when sorting on a field Solr knows you shouldn't sort on. > --------------------------------------------------------------------------- > > Key: SOLR-2339 > URL: https://issues.apache.org/jira/browse/SOLR-2339 > Project: Solr > Issue Type: Bug > Components: search > Reporter: Hoss Man > Assignee: Hoss Man > Fix For: 3.1, 4.0 > > Attachments: SOLR-2339.patch > > > In the past, Solr has relied on the underlying FieldCache to throw an error > in situations where sorting on a field was not possible. however LUCENE-2142 > has changed this, so that FieldCache never throws an error. > In order to maintain the functionality of past Solr releases (ie: error when > users attempt to sort on a field that we known will produce meaningless > results) we should add some sort of check at the Solr level. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org