lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <>
Subject Re: How to sort value that numeric mix alpha
Date Sun, 29 Jun 2014 15:03:28 GMT
I think you wanted to remove letters, but your pattern removes NON-letters - 
that's what the "^" does, negation.

So, try: ="[a-z]".

You can also get rid of the lower case filter and just use "[a-zA-Z]".

-- Jack Krupansky

-----Original Message----- 
From: rachun
Sent: Sunday, June 29, 2014 3:19 AM
Subject: How to sort value that numeric mix alpha

Dear all,

Could anybody suggest me how to sort the field that has numeric mix with
In my case I have field name 'product_id' which contain value  like

when I try to sort (DESC) it return wrong result something like this

As you see I have 'C' for prefix.

So, In my Schema.xml I have tried this...

   <fieldType name="alphaOnlySort" class="solr.TextField"
sortMissingLast="true" omitNorms="true">
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
        <filter class="solr.TrimFilterFactory" />
        <filter class="solr.PatternReplaceFilterFactory"
                pattern="([^a-z])" replacement="" replace="all"

<field name="pid_sort" type="alphaOnlySort" indexed="true" stored="true" />

<copyField source="product_id" dest="pid_sort"/>

but it didn't work. How to deal with this?

Thank you very much,

View this message in context:
Sent from the Solr - User mailing list archive at 

View raw message