You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Solr doesn't allow sorting on multivalue fields, but the SolrSearch plugins index configuration allows any field to be selected as a sort field. If you select a multivalue field to be a sort field and then try it, you get an exception in Solr:
org.apache.solr.core.SolrCore - org.apache.solr.common.SolrException: can not sort on multivalued field: 40_s
at org.apache.solr.schema.SchemaField.checkSortability(SchemaField.java:161)
at org.apache.solr.schema.FieldType.getStringSort(FieldType.java:527)
at org.apache.solr.schema.StrField.getSortField(StrField.java:40)
at org.apache.solr.schema.SchemaField.getSortField(SchemaField.java:144)
at org.apache.solr.search.QueryParsing.parseSort(QueryParsing.java:385)
at org.apache.solr.search.QParser.getSort(QParser.java:251)
at org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:102)
at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:173)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1372)
at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
The text was updated successfully, but these errors were encountered:
which means all fields are multivalued by default. So how does sort work at all when solr can't sort on multivalued fields? Or did Solr 3.6 add this? I'm using 3.5.
As a workaround, for fields you know aren't multivalued you can add the following to your solr schema config:
<field name="sortedTitle" type="text" indexed="true" stored="false" multiValued="false"/>
<!-- 50_s would be whatever the field is in your omeka install -->
<copyField source="50_s" dest="sortedTitle" />
If you add that for a field that really is multivalued though you'll get an error on indexing.
We're stuck between two systems, here. Because we want to define fields dynamically and because all fields in Omeka can take multiple values, they all have to be marked multiValue for Solr. But Solr cannot sort multivalue fields.
Solr doesn't allow sorting on multivalue fields, but the SolrSearch plugins index configuration allows any field to be selected as a sort field. If you select a multivalue field to be a sort field and then try it, you get an exception in Solr:
org.apache.solr.core.SolrCore - org.apache.solr.common.SolrException: can not sort on multivalued field: 40_s
at org.apache.solr.schema.SchemaField.checkSortability(SchemaField.java:161)
at org.apache.solr.schema.FieldType.getStringSort(FieldType.java:527)
at org.apache.solr.schema.StrField.getSortField(StrField.java:40)
at org.apache.solr.schema.SchemaField.getSortField(SchemaField.java:144)
at org.apache.solr.search.QueryParsing.parseSort(QueryParsing.java:385)
at org.apache.solr.search.QParser.getSort(QParser.java:251)
at org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:102)
at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:173)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1372)
at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
The text was updated successfully, but these errors were encountered: