lucene - Sorting on multivalued field in Solr -


i know multivalued field sorting not supported in solr . there way can sort multivalued field in solr. have 2 documents field custom_code , values below,

doc 1 : 11, 78, 45, 22

doc 2 : 56, 74, 62, 10

when sort in ascending order order should ,

doc 2 : 56, 74, 62, 10

doc 1 : 11, 78, 45, 22

here doc 2 come first because has smallest element 10 (which greater 11 of doc 1).

how can achieve in solr. easiest way?

create copyfield copy content of multivalued data sorted concatenated single value without commas , use sorting.

for ex :

doc 1 :

multivalueddata : 11, 78, 45, 22

sortedconcatenatedsinglevalue : 11224578

doc 2 :

multivalueddata : 56, 74, 62, 10

sortedconcatenatedsinglevalue : 10566274

if cannot create singlvalue field @ time of generating data source can use script transformer (https://wiki.apache.org/solr/dataimporthandler#scripttransformer) during index time create sortedconcatenatedsinglevalue field using javascript function.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -