collectionsonline
collectionsonline copied to clipboard
When displaying an archive, display the 'fonds' record as the first result (if no other query)
ie. BAB should be in the top-left, followed by the series->sub-series in sequence order.
Effectively (when linking to the root/top/fonds record for the Babbage Papers) http://collectionsonline-staging.eu-west-1.elasticbeanstalk.com/search/documents?filter[archive]=The%20Babbage%20Papers
The SERP page should mirror/follow the order of the 'archive browser' ie. http://collection.sciencemuseum.org.uk/documents/aa110000003 [this is only if no other 'free text' query string provided]
Ideally, when linking direct / filtering by a series record (which I am to sure we can really do yet, maybe we need a separate issue for this?). The SERP page should follow should mirror/follow the order of the 'archive browser' on a series level page ie. http://collection.sciencemuseum.org.uk/documents/aa110000010
@jamieu just a recap on this issue. I tried first to implement an easy solution: instead of letting Elasticsearch displaying the list of results by calculating the weight of each items I tried to sort the element by their identifier (BAB, BAB/A,...) The sorting seems more complicated and doesn't work as expected. Also the fonds element (the top one) is not display as the filter is only filtering on the "fonds.summary_title" field which only the "series" or "item" type of element (the sub element) have.
I then tried to reuse the current function used for getting the "trees archive". At the moment the archives "tree" can be extracted from the cached document function. However this function takes the id of the document and the id or the fonds which we don't have access from the search page. So we might need to create a new function or adapt the existing one to get the archive tree from the name of a fonds directly. Another issue is to include more data in the archive tree to be able to displaying it as a search page, we at least to add the link to the images to be able to display it as a card. Finally the way to extract the archive tree is not a search so all the logic build on a search (pagination, facets, filters) will need to be integrated again and might need to be updated to be able to display them in the archive tree new view.
So my next steps are:
- to create a new route (/browse-archive/{nameFonds}) which will build the list of archive in the right order. At the end this will be just a card representation of the current archive tree that we can see on a document page.
- To extract the other information of a search page - pagination, facets, filters and add them to the new view
- Once the all view is build we can then redirect automatically the user when she filters on an archive without a query to this new route
So to recap the main difficulty is to create a page which looks like a search page done without Elasticsearch logic. We want another logic to build the page (using the archive tree) so we need to integrate all the elements of the search page with this new logic.
@jamieu is this clear (I'm not sure)? It might take a bit longer to implement everything but I want to create the first step ( create a new page which will display the archive tree as cards)