cancel
Showing results for 
Search instead for 
Did you mean: 

custom field search failure

lauraeis
Champ in-the-making
Champ in-the-making
Hi,
Is there any problem with using text field in search sort?
I have created a sorting fields and labels:
          <sort labelId="search.sort.relevance"></sort>
     <sort labelId="Numurs">custom:documentRegNumber</sort>
     <sort labelId="Dokumenta veids">custom:documentType</sort>
          <sort labelId="Dokumenta nosaukums">custom:documentNameClasification</sort>
     <sort labelId="Datums">cm:created|false</sort>
     <sort labelId="Autors">cm:author</sort>
     <sort labelId="Arhīva lietas numurs">custom:archiveCaseNumber</sort>
     <sort labelId="Rediģēšanas datums (pēdējais)">cm:modified</sort>
     <sort labelId="search.sort.mimetype">.mimetype</sort>

Everything works fine (custom category fields too) except custom:documentRegNumber and custom:archiveCaseNumber witch are text types:
    <property name="custom:documentRegNumber">
          <title>Dokumenta reģistrācijas numurs</title>
          <type>d:text</type>
          <mandatory>true</mandatory>
    </property>
    <property name="custom:archiveCaseNumber">
          <title>Arhīva lietas numurs</title>
          <type>d:text</type>
          <mandatory>false</mandatory>
    </property>

In log file I get:
2012-12-04 18:44:25,923  ERROR [solr.core.SolrCore] [http-bio-8443-exec-1] java.lang.UnsupportedOperationException: Ordering not supported for @{custom.model}documentRegNumber

So, I want to know, is there any problem with using text field in sorting or I am doing something wrong?

Regards,
Laura
2 REPLIES 2

andy
Champ on-the-rise
Champ on-the-rise
Hi

Text fields are not orderable unless unless they are tokenised "false" or "both".
It generally makes no sense to sort on tokenised fields as the sort by the lowest token generated.

Andy

maddy
Champ in-the-making
Champ in-the-making
HTTP Status 500 - Ordering not supported for {http://www.cchindia.co.in/model/cch/dtax/article/1.0}subtopic java.lang.UnsupportedOperationException: Ordering not supported for