From: Demian K. <dem...@vi...> - 2012-12-27 14:07:22
|
Is it intentional that the publishDate field is being given the "script" BeanShell version (comma-delimited list) while the publishDateSort field is being given the "custom" (i.e. built-in SolrMarc) version (first year string only)? Is it possible that you haven't fully reindexed since upgrading from an earlier version of VuFind? Changes in date sorting behavior between 1.2 and 1.3 have been known to cause problems if the index is not rebuilt. If that doesn't help (or if you want to set up some extra debugging while you are reindexing), it might be worth modifying the schema to temporarily make the publishDateSort field "stored=true" so that after reindexing, you can view the Solr output and see exactly which values are being used for sorting. If you want to try this but need more details how, just let me know. - Demian ________________________________ From: Steven P. Johnson [st...@ar...] Sent: Wednesday, December 26, 2012 5:46 PM To: vuf...@li... Subject: [VuFind-Tech] Sort by date, VuFind 1.3 Sorting by date/year of publication is not working in a VuFind 1.3 collection, though search by year works. Both ascending and descending date/year sorts return records in no obviously sorted order. In this collection, the only collection in this instance of VuFind, the 518a field was used, rather than 260c, for date of publication. In marc_local.properties, fields are defined as : publishDate = 518c publishDate = script(getdate.bsh), getDate publishDateSort = custom, getDate In getDate.bsh, I made changes only in the last section: /** * Project is using 518a as a date string * Return the date in 260c as a string * @param record - the marc record object * @return 260c, "cleaned" per org.solrmarc.tools.Utils.cleanDate() */ public String getDate(Record record) { Set result = SolrIndexer.getFieldList(record, "518a"); /* Set result = SolrIndexer.getFieldList(record, "260c"); */ String date = org.solrmarc.tools.Utils.join(result, ", "); if (date == null || date.length() == 0) return (null); return cleanDate(date); } My guess is that I need to make corresponding changes in one or more places in VuFind. I would appreciate any leads. Thank you, Steve Johnson Alaska Resources Library & Information Services (ARLIS) Anchorage, AK 99508 907 786-7661 st...@ar...<mailto:st...@ar...> |