From: Steven P. J. <st...@ar...> - 2012-12-26 23:11:16
|
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...> |
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...> |
From: Steven P. J. <st...@ar...> - 2012-12-27 16:00:53
|
Demian Thank you for your comments and suggestions, to which I reply below. Pending a solutiojn to problem, is there an easy method to turn off the ascending/descending sorts by date? (1). 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)? Reply: The script and custom values for publishDate and publishDateSort were as I found them in the blueprint theme. Changing the value for publishDateSort to script without any further change causes fatal errors on input. (2) 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. Reply: This instance of VuFind is not an upgrade; it started with version 1.3. (3) 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. Reply; I have set the value of publishDateSort stored to "true" and will have a look at results. Again, thank you for your comments. Steve Johnson Alaska Resources Library & Information Services (ARLIS) Anchorage, AK 99508 907 786-7661 st...@ar...<mailto:st...@ar...> ________________________________ 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...> |
From: Steven P. J. <st...@ar...> - 2012-12-27 18:21:02
|
Demian Evidently my memory & brainworks cannot be trusted before the morning dog walk and bike ride to work... During the walk and ride, I recalled that of course I was the one who set those publishDate and publishDatesort values in marc_local.properties. (And why did I mention a theme?) Per the documentation, I had copied and edited the publishDate lines from marc.properties. In an attempt to get the date sort to work, I pulled the line "publishDateSort = custom, getDate" directly from the schema.xml, in my typical trial and error way, and learned that the results were not as desired. (Several other variations resulted in fatal errors in indexing.) I removed the date sorts from searches.ini on the production server and will work with date sorting on the test server. Thank you for your assistance. Steve Steve Johnson Alaska Resources Library & Information Services (ARLIS) Anchorage, AK 99508 907 786-7661 st...@ar...<mailto:st...@ar...> From: Demian Katz [mailto:dem...@vi...] Sent: Thursday, December 27, 2012 5:07 AM To: Steven P. Johnson; vuf...@li... Subject: RE: Sort by date, VuFind 1.3 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...<mailto: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...> |
From: Demian K. <dem...@vi...> - 2012-12-28 12:34:30
|
Not a problem! Editing searches.ini is a good workaround to hide the problem for now, and hopefully you'll find something meaningful when you reindex with the stored field. Let me know if you need more help troubleshooting or analyzing results once you reach that point. - Demian ________________________________ From: Steven P. Johnson [st...@ar...] Sent: Thursday, December 27, 2012 1:20 PM To: Demian Katz; vuf...@li... Subject: RE: Sort by date, VuFind 1.3 Demian Evidently my memory & brainworks cannot be trusted before the morning dog walk and bike ride to work… During the walk and ride, I recalled that of course I was the one who set those publishDate and publishDatesort values in marc_local.properties. (And why did I mention a theme?) Per the documentation, I had copied and edited the publishDate lines from marc.properties. In an attempt to get the date sort to work, I pulled the line “publishDateSort = custom, getDate” directly from the schema.xml, in my typical trial and error way, and learned that the results were not as desired. (Several other variations resulted in fatal errors in indexing.) I removed the date sorts from searches.ini on the production server and will work with date sorting on the test server. Thank you for your assistance. Steve Steve Johnson Alaska Resources Library & Information Services (ARLIS) Anchorage, AK 99508 907 786-7661 st...@ar...<mailto:st...@ar...> From: Demian Katz [mailto:dem...@vi...] Sent: Thursday, December 27, 2012 5:07 AM To: Steven P. Johnson; vuf...@li... Subject: RE: Sort by date, VuFind 1.3 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...<mailto: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...> |