I tried sorting by productType but it seems to be not working properly.
I already have sort on query before inserting to SOLR.
Sorting can be done on the documents provided that document field is either non-tokenized (ie: has no Analyzer) or uses an Analyzer that only produces a single Term (ie: uses the KeywordTokenizer)
And it should multiValued="false" indexed="true"
check you analyzer for the field productType
changing class from solr.TextField
to solr.StrField
for you field productTye
might help.
Many questions are asked on multi-value sort on solr, and same problem I was also face.
I solved my problem with the help of @PrabhuVelayutham answer on this link.
He is saying.
"Create a copyfield to copy the content of multivalued data into a sorted concatenated single value without commas and use it for sorting.
For Ex :
Doc 1 :
multiValuedData : 11, 78, 45, 22
sortedConcatenatedSingleValue : 11224578
Doc 2 :
multiValuedData : 56, 74, 62, 10
sortedConcatenatedSingleValue : 10566274 "
You can go throw it and surly, you will get your result.