IUBLibTech / newton_chymistry

New version of 'The Chymistry of Isaac Newton', using XProc pipelines to generate a website based on TEI XML encodings of Newton's alchemical manuscripts, and Apache Solr as a search engine.
2 stars 0 forks source link

Browse Manuscripts #11

Closed Conal-Tuohy closed 4 years ago

Conal-Tuohy commented 5 years ago

By default, show "short display" of all manuscripts in A-Z order by institution

mdalmau commented 5 years ago

A-Z order by institution's location (@wehooper will ID the element). All manuscripts results should display when clicking "Browse Manuscripts." We won't need pagination for the Browse results like we have on the current website because of facets! Yay facets.

Conal-Tuohy commented 5 years ago

So it the requirement here for a separate page (separate from the search page)?

I don't understand the comment about pagination and facets.

wehooper commented 5 years ago

On the current (XTF-P4) site, when the user clicks on "Browse Manuscripts," the queryParser.xsl sheet determines the order of results in template match ="/", at or around line 48. It uses three components, sort-settlement, sort-collection, and sort-shelfmark, which all defined in preFilter.xsl. The preFilter definitions draw from the settlement, collection, and shelfmark elements in the document TEI headers. Basically a few years we decided that the documents would sorted by location, collection, and then shelfmark. The collection and shelfmark are fairly straightforward, but the location can present some problems because there are two Cambridge settlements, one in the UK, the other in Massachusetts, and the UK should come first, UK < USA.

Conal-Tuohy commented 5 years ago

I have made a few tweaks to the indexing and search system, so that a sort field can be defined in the search-fields.xml file. I have defined a field called sort, and I've populated it with an XPath expression which I believe captures the correct sort order:

string-join(
    (
        /TEI/teiHeader/fileDesc/sourceDesc/msDesc/msIdentifier/settlement,
        /TEI/teiHeader/fileDesc/sourceDesc/msDesc/msIdentifier[country/@key='US']/region/@key,
        /TEI/teiHeader/fileDesc/sourceDesc/msDesc/msIdentifier/altIdentifier/idno[@type='collection'],
        /TEI/teiHeader/fileDesc/sourceDesc/msDesc/msIdentifier/idno
    ),
    ' '
)

I have then altered the Solr query so that it uses this sort field to sort results. Specifically, the sort order requested is for hits in order of relevance score, and then in order of this sort field. My reasoning is that when a user searches e.g. for "gold", they will want the results in relevance order, but when they are simply browsing without any search constraints then the documents should have equal scores, and this sort order should apply.

Let me know what you think, please

mdalmau commented 4 years ago

@wehooper could you have a look? This seems right to me, but it would be good to have a long-time project team member to confirm.

mdalmau commented 4 years ago

I assuming this was reviewed per the 12/13/2019 email so I will close this issue.