project-lux / lux-marklogic

Code, issues, and resources related to LUX MarkLogic
Other
3 stars 2 forks source link

Add support for sorting items by their archive sort values - supports FE 27 #90

Closed brent-hartwig closed 1 month ago

brent-hartwig commented 3 months ago

UAT Review:

Evidence of this work is shown in https://github.com/project-lux/lux-middletier/issues/47 and https://github.com/project-lux/lux-frontend/issues/27

Issue Description

This is the initial action item coming out of #38.

A subset of LUX Object records are associated to an archive. Those records are associated to a collection of its archive and have a certain value to sort by with respect to its collection (respect des fonds).

The scope of this ticket is to add support for sorting by this value. Initially, only one sort value per Object will be supported, and the value to sort on is to be within the Object record.

Implementation is expected to follow suit with other sort-by criteria LUX supports that are backed by a range index. A range index for this piece of data does not yet exist. In the following illustration, no. 1 is the value to index and no. 3 helps identify the value to index. No. 2 is out of this ticket's scope but could later be utilized to support sort values for other sets.

image

XPath in action:

const objectRecordUri = 'https://lux.collections.yale.edu/data/object/400a5e33-1cf2-4274-97f9-0340b6ca57fa';
const sortId = 'https://lux.collections.yale.edu/data/concept/ab99d278-9323-4d84-8e97-1846058fc587';
cts.doc(objectRecordUri).xpath(`/json/identified_by[classified_as/id='${sortId}']/content`);

Note that the value of the sortId needs to be a data constant.

The intended use of this sort is from a Set entity page and not the Objects search tab.

Dependencies/Blocks Blocking: https://github.com/project-lux/lux-middletier/issues/47 and https://github.com/project-lux/lux-frontend/issues/27

clarkepeterf commented 3 months ago

@azaroth42 @kkdavis14 Can you add a pipeline data constant for https://lux.collections.yale.edu/data/concept/ab99d278-9323-4d84-8e97-1846058fc587 (http://vocab.getty.edu/aat/300451544)

Need for pipeline data constants should go away once we form and implement https://github.com/project-lux/lux-marklogic/issues/54, but for now I think it is easiest to add a pipeline data constant.

brent-hartwig commented 3 months ago

@clarkepeterf, how about asking the data constant generator to do it?

clarkepeterf commented 2 months ago

@brent-hartwig it can't be generated in ML, it has to be a pipeline data constant because it is going to be used in an index. I'm not aware of how to set up data constants in the pipeline

brent-hartwig commented 2 months ago

Peter set me straight and is correct: the data constant needs to come from the data pipeline as that subset of data constants is the only subset available when generating the database index configuration, which includes data constant references.

clarkepeterf commented 2 months ago

Still need pipeline data constant. Pushing to next release

azaroth42 commented 2 months ago

This should use the technique in https://github.com/project-lux/lux-marklogic/issues/54

If we need a temporary fix, just edit the JSON file and add the URIs?

clarkepeterf commented 2 months ago

Note - it is also desired to have an index for Works / (Archival Sets)

roamye commented 1 month ago

UAT from middle tier ticket looks good in prod. Closing