Could you replace it with something that will sort it last instead of an empty 
string?  (Say, for example, replacement="{}").  This would still give something 
that looks empty to a person, and would sort last.

BTW, it looks to me as though your pattern only requires that the input contain 
just ONE non-roman character.  For it to consist of ALL (and including at least 
one) non-roman characters, I think your pattern should be  "(^[^a-z]+$)".  

JRJ


-----Original Message-----
From: themanwho [mailto:theman...@mac.com] 
Sent: Monday, October 24, 2011 3:29 PM
To: solr-user@lucene.apache.org
Subject: sort non-roman character strings last

As the subject line says, when sorting documents on a field that may contain 
only non-roman characters, I would like sort those documents last.  My initial 
approach was a pattern replacement filter:

First of all, lowercase everything...

then...

<filter class="solr.PatternReplaceFilterFactory" pattern="([^a-z])" 
replacement="" replace="all">

(along with sortMissingLast=true)

The analysis servlet demonstrates the fieldtype is doing what it needs to do -- 
that is, if the field is strictly non-roman, I wind up with a null string.  
However, when I sort ascending, these pesky documents still sort at the top of 
the list.

What am I doing wrong or misunderstanding here?  Guess -- does a null string 
not qualify as a missing field?

Any suggestions?
Thanks a million for any clues.

Bill

Human wheels spin round and round
While the clock keeps the pace... -- John Mellencamp
________________________________________________________________
Bill Tantzen    University of Minnesota Libraries
612-626-9949 (U of M)    612-325-1777 (cell)



--
View this message in context: 
http://lucene.472066.n3.nabble.com/sort-non-roman-character-strings-last-tp3449415p3449415.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to