From: Demian K. <dem...@vi...> - 2012-12-03 20:43:42
|
Hmm... I would have thought modifying the skip indicator would have been a reasonable solution to the problem, but now that I review the MARC specs, I see that, as written, it seems to be intended solely for leading articles and not for leading punctuation. This seems silly, but... that's MARC. To help you with option #2, the custom indexing routine, I am attaching a BeanShell file that contains the default SolrMarc code for retrieving sortable titles. To use this version of the code instead of the built-in version, just put the file into your import/index_scripts directory under VuFind, and modify your marc.properties (or marc_local.properties, if you use that) to include: title_sort = script(getSortableTitle.bsh), getSortableTitle Now you just need to adjust the script to strip leading punctuation. You can probably use a simple regular expression. Before this line: if ( title.length() == 0) { ...add something like: title = title.replaceAll("^[\"']*", ""); (you can put a list of punctuation characters you want to strip inside the brackets of the regular expression ... this example just removes single and double quotes). Now you need to reindex all your records for the fix to take effect. I hope this is helpful -- if you get partway there but run into trouble, feel free to share a modified version of the script and a sample MARC record that isn't indexing correctly, and I'll give it a closer look on my test server. No guarantees that any of this code works exactly right (I haven't had time to test it), but hopefully it gets you in the right neighborhood. Let me know if you have questions. - Demian > -----Original Message----- > From: Karla Smith [mailto:sm...@wi...] > Sent: Monday, December 03, 2012 3:22 PM > To: 'vuf...@li...' > Cc: 'vuf...@li...' > Subject: [VuFind-Tech] Title sort puts punctuation first--Revisited > > Hi, > I talked to our catalogers and was told in no uncertain terms that modifying > the MARC skip indicator to eliminate leading punctuation is NOT an option. > > Plus, I've noticed that some VuFind sites (Marmot and Philly Free Library, and > maybe others) have managed to get Title sort to ignore leading punctuation. > And, they haven't modified their skip indicators. > > So, I'm wondering: > a) Is anyone who has already fixed the issue willing to share exactly how they > did it? I wouldn't have the foggiest notion how to "Write a custom indexing > routine that strips punctuation in addition to respecting the skip indicator > when populating the title_sort field." > > b) Should incorporating stripping leading punctuation when doing a Title sort > be on the "to-do" list for future VuFind development? Or is it already on the > list and I didn't notice? > > Thanks, > --Karla > Karla Smith, ILS Manager > Winnefox Library System > Oshkosh, WI 54904 > ~If Truth is Beauty, how come no one has their hair done in the library? - > Lily Tomlin > > -----Original Message----- > From: Demian Katz [mailto:dem...@vi...] > Sent: Tuesday, June 12, 2012 3:02 PM > To: Karla Smith; vuf...@li... > Subject: RE: Title sort puts punctuation first > > I believe that titles which start with punctuation should have the MARC skip > indicator in the 245 field set to bypass the punctuation. This detail is > commonly omitted, which causes sorting problems. So two possible solutions: > > 1.) Fix the cataloging and reindex. > > 2.) Write a custom indexing routine that strips punctuation in addition to > respecting the skip indicator when populating the title_sort field. > > - Demian > > > -----Original Message----- > > From: Karla Smith [mailto:sm...@wi...] > > Sent: Tuesday, June 12, 2012 3:47 PM > > To: vuf...@li... > > Subject: [VuFind-General] Title sort puts punctuation first > > > > Hi, > > I've been following the thread on fixing the sort for the Alphabetical > Browse, > > but I'm not sure that solution would apply to my problem which is: > > > > When I choose Sort by Title in the dropdown menu, it does an ascii sort and > > puts all the punctuation and numbers first before it ever gets to A. I > noticed > > several VuFind sites have this issue. > > > > Is there a way to fix that? > > > > --Karla > > Karla Smith > > Winnefox Library System > > Oshkosh, WI 54901 > > sm...@wi... > > ~Sometimes the only solution is to find a new problem. > > > > > > ---------------------------------------------------------------------------- > -- > > Live Security Virtual Conference > > Exclusive live event will cover all the ways today's security and > > threat landscape has changed and how IT managers can respond. Discussions > > will include endpoint security, mobile security and the latest in malware > > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > _______________________________________________ > > VuFind-General mailing list > > VuF...@li... > > https://lists.sourceforge.net/lists/listinfo/vufind-general > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > > ------------------------------------------------------------------------------ > Keep yourself connected to Go Parallel: > BUILD Helping you discover the best ways to construct your parallel projects. > http://goparallel.sourceforge.net > _______________________________________________ > Vufind-tech mailing list > Vuf...@li... > https://lists.sourceforge.net/lists/listinfo/vufind-tech |