Problem Description:
Searches that do not require scores are slower than they need to be. This optimization was identified during the CTS / Optic API comparison effort. Note that the value of this optimization will likely be fairly low so long as our default sort uses scores --a different topic for discussion.
Expected Behavior/Solution:
When scores are not needed, instruct MarkLogic not to calculate them. At present, scores are only used for two search result sort options.
Requirements:
More of a design than requirements:
Implement the likes of SortCriteria.areScoresRequired() and have it return a new member variable's boolean value. It should be true if and only if SortCriteria._parse adds at least one one call to cts.indexOrder and only adds calls to cts.indexOrder. Note that LUX as a whole only supports sorting by a single criteria while SortCriteria supports multiple. My preference is for SortCriteria to continue supporting multiple.
Update SearchCriteriaProcessor.getCtsQueryStr() to add "score-zero" an an option into cts.search() when sortCriteria.areScoresRequired() returns false.
Needed for promotion:
If an item on the list is not needed, it should be crossed off but not removed.
[x] ~Wireframe/Mockup - Mike~
[ ] Committee discussions - Sarah
[ ] Feasibility/Team discussion - Sarah
[x] Backend requirements - see above
[x] ~Frontend requirements~- none
[ ] Questions
List of questions for discussions. Answers should be documented within the issue.
Problem Description: Searches that do not require scores are slower than they need to be. This optimization was identified during the CTS / Optic API comparison effort. Note that the value of this optimization will likely be fairly low so long as our default sort uses scores --a different topic for discussion.
Expected Behavior/Solution: When scores are not needed, instruct MarkLogic not to calculate them. At present, scores are only used for two search result sort options.
Requirements: More of a design than requirements:
SortCriteria.areScoresRequired()
and have it return a new member variable's boolean value. It should betrue
if and only ifSortCriteria._parse
adds at least one one call tocts.indexOrder
and only adds calls tocts.indexOrder
. Note that LUX as a whole only supports sorting by a single criteria whileSortCriteria
supports multiple. My preference is forSortCriteria
to continue supporting multiple.SearchCriteriaProcessor.getCtsQueryStr()
to add"score-zero"
an an option intocts.search()
whensortCriteria.areScoresRequired()
returnsfalse
.Needed for promotion: If an item on the list is not needed, it should be crossed off but not removed.
UAT/LUX Examples:
Verification would likely requiring reviewing the generated query, which one can do using https://github.com/project-lux/lux-marklogic/blob/main/scripts/getCtsQueryForSearchCriteria.js within QC by also passing in an instance of
SortCriteria
into the call toprocessSearchCriteria
. Or consume the endpoint and get the query from the logs.Scenarios to test include:
Dependencies/Blocks:
Related Github Issues:
None
Related links:
None
Wireframe/Mockup:
Not needed