Week Beginning 6th March 2023
This week I continued to focus primarily on the development of the Books and Borrowing front-end, making various updates to the search and browse facilities. I investigated an issue with authors not appearing in the Solr data and located the cache generation scripts I’d previously written but hadn’t re-run recently. These include generating cached data for authors and also things like number of borrowings. I have now updated my ‘Solr data generation how to’ document to note that these cache generation scripts need to be re-run so hopefully this shouldn’t be an issue in future. I’ve also re-run all of the scripts now but this won’t affect anything until I send new data to the Stirling IT people.
I also updated my Solr generation scripts to split up edition languages and place of publication on the bar character (and also separating out any places in square brackets). This means each language and place will be independently searchable in future. I have also updated the advanced search form so that languages and places are split by the bar character. For language this means that where a language had a bar (e.g. ‘Latin | Arabic’) the associated count then gets added to each of the individual occurrences of the language. The list of languages on the advanced search form is now much more reasonable and less cluttered.
I was considering replacing the auto-complete for place of publication with a multi-select, but I’ve decided against this as even with the bar splitting there are still about 350 different places, which is too much. Instead I’ve updated the autocomplete to bring back individual places. For example previously ‘Stirling’ appeared in a long list of places all separated by bars and this is what was returned when you typed ‘Stirling’ in. Now only ‘Stirling’ appears.
I then created a new API endpoint to retrieve the data for a single borrower and I now use this call when a user presses on a borrower name in the search results, enabling me to display the borrower name in the ‘You searched for’ section rather than just the borrower ID. I have also updated things so that if you do press on a borrower name to search for all records involving the borrower, plus you can now press ‘refine your search’ and the borrower’s details (title, forename, surname, othernames) will populate the advanced search form, which is quite nice. Note however that if you do this then press the ‘Search’ button this then searches on these fields and not the specific borrower ID, so the results may be very different (e.g. multiple John Smiths).
I also realised that I will need to rethink how the pubdate search works as I’d forgotten that we have both ‘pubdate’ and ‘pubdateend’ fields. Currently I have just been using ‘pubdate’ but this is not going to give accurate results where we have a range of years. Instead I’m generating and saving each year in the range. This allows the search to work without updating the code, and after testing it out all would appear to work very well.
I then worked on adding in more ‘click to search’ options to the search results page. I added in a search option for ‘Holding title’ that when clicked on searches for the holding title’s ID (and populates the search form with the holding title if you choose to refine your search). Unfortunately I realised that I had somehow not included the book holding ID as a field in the Solr data. I therefore updated the schema on my laptop and regenerated and ingested the data into Solr on my laptop to check that the process worked. Thankfully all went smoothly, but it does mean that until I next update the live Solr data the ‘click to search’ for holding title doesn’t actually provide any results.
I also added in ‘click to search’ for book edition and book work title. I had included the book edition and work IDs in the Solr data so thankfully I was able to get these searches working fully. As with book holding, when you click on a title to perform the search and then choose to refine your search the edition / work title appears in the advanced search form.
I also added in a similar option for authors. You can now click on an author’s name at any of the levels of association and a search for author ID will be performed, with author forename and surname appearing in the advanced search form if you ‘refine’.
I then moved on to adding in ‘click to search’ for edition language and publication place. These also had their own challenges as I needed to split up languages / publication places into individual clickable areas based on the bar character and also the square brackets for publication place. I managed to get it all working, but of course this search won’t work properly until the Solr data is updated anyway.
Also this week I had an email conversation with Ophira Gamliel about a new project that will be starting soon. We discussed how the project’s website will function, interactive maps, URLs, page design and other such matters. I’ll be starting on this sometime after Easter.