Dear all,

Could anybody suggest me how to sort the field that has numeric mix with
alpha.
In my case I have field name 'product_id' which contain value  like
C1,C2,C3,C4,C9,C12,C23,C50

when I try to sort (DESC) it return wrong result something like this
C9,C50,C4,C3,C23,C2,C12,C1

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">
      <analyzer>
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
        <filter class="solr.TrimFilterFactory" />
        <filter class="solr.PatternReplaceFilterFactory"
                pattern="([^a-z])" replacement="" replace="all"
        />
      </analyzer>
    </fieldType> 

<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,
Chun.







--
View this message in context: 
http://lucene.472066.n3.nabble.com/How-to-sort-value-that-numeric-mix-alpha-tp4144615.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to