project-lux / lux-marklogic

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

Fix Comparators #332

Closed clarkepeterf closed 1 week ago

clarkepeterf commented 1 week ago

Problem Description: '>=' and '<=' don't always match results when they are expected to match results.

E.g. this matches 0 results:

{
    "AND": [
        {
            "producedBy": {
                "id": "https://lux.collections.yale.edu/data/person/34f4eec7-7a03-49c8-b1be-976c2f6ba6ba"
            }
        },
        {
            "producedDate": "1945-12-31T00:00:00.000Z",
            "_comp": "<="
        },
        {
            "producedDate": "1945-01-01T00:00:00.000Z",
            "_comp": ">="
        }
    ]
}

But this matches 29 results:

{
    "AND": [
        {
            "producedBy": {
                "id": "https://lux.collections.yale.edu/data/person/34f4eec7-7a03-49c8-b1be-976c2f6ba6ba"
            }
        },
        {
            "producedDate": "1946-01-01T00:00:00.000Z",
            "_comp": "<"
        },
        {
            "producedDate": "1944-12-31T00:00:00.000Z",
            "_comp": ">"
        }
    ]
}

They should be equivalent.

Expected Behavior/Solution: Make <= and >= work as expected.

Requirements:

Needed for promotion: If an item on the list is not needed, it should be crossed off but not removed.

UAT/LUX Examples: This search should have results: https://lux-front-tst.collections.yale.edu/view/results/objects?q=%7B%22AND%22%3A%5B%7B%22producedBy%22%3A%7B%22id%22%3A%22https%3A%2F%2Flux.collections.yale.edu%2Fdata%2Fperson%2F34f4eec7-7a03-49c8-b1be-976c2f6ba6ba%22%7D%7D%2C%7B%22producedDate%22%3A%221945-12-31T00%3A00%3A00.000Z%22%2C%22_comp%22%3A%22%3C%3D%22%7D%2C%7B%22producedDate%22%3A%221945-01-01T00%3A00%3A00.000Z%22%2C%22_comp%22%3A%22%3E%3D%22%7D%5D%7D

- Example endpoints from LUX to use for development and testing, if applicable.

Dependencies/Blocks:

- Blocked By: Issues that are blocking the completion of the current issue. - Blocking: Issues being blocked by the completion of the current issue.

Related Github Issues:

Related links:

- These links can consist of resources, bugherds, etc.

~~Wireframe/Mockup: Place wireframe/mockup for the proposed solution at end of ticket.~~

roamye commented 1 week ago

@clarkepeterf - both prd and tst link have results. Is there another uat example which shows the difference between prd and test?

clarkepeterf commented 1 week ago

@roamye this was deployed to PRD as a hotfix so it is fixed everywhere

roamye commented 1 week ago

ahh okay thanks! @clarkepeterf propose close

roamye commented 1 week ago

Approved by UAT to close.