简体   繁体   中英

Solr Multivalued fields to string

I have a SOLR instance which is fed from a 3rd party application and one of the fields is multivalued and returns like Below

<arr name="site_code">
      <str>4A</str>
      <str>R3</str>
      <str>UK</str>

However another requirment is for the application to display the values as a comma separated list 4A,R3,UK.

I have tried to create a copyfield from site_code into a field call site_code_csv but it doesnt work. Is there a way this can be done?

thanks

Andy

To get information out of Solr in the format 4A,R3,UK you can simply change the output format in Solr for your individual query:

Add wt=csv (wt is "writer type/response format") to your query.

Documentation: http://wiki.apache.org/solr/CSVResponseWriter

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM