project-lux / lux-marklogic

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

Research: Optimization For Nested Semantic Queries - Time out Issue in Advanced Search #113

Open roamye opened 2 months ago

roamye commented 2 months ago

Problem Description: There is a time out issue which occurs in advanced search for a query which has a small amount of results. For example, before adding another line to this query it returns 25 results. However, if we add to this query to look for results which include NO online images in objects it will have a time out issue which can be seen in the link in UAT.

This happens because the nested query does not search for online images from the 25 results, but instead it searches from all the records which have online images which causes the time out issue.

Expected Behavior/Solution: Research adding in an optimization to reduce the number of results for nested semantic queries using criteria from higher up in the query.

Example - turning this broken search into this optimized search

Other possible things that could help this problem Possible solutions from the teams thread is to:

Requirements:

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

UAT/LUX Examples:

Dependencies/Blocks:

Related Github Issues:

Related links:

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

roamye commented 2 months ago

should brent also be added to this issue? He was part of the original thread convo but unsure of what his workload looks like.

cc: @prowns @clarkepeterf

brent-hartwig commented 2 months ago

@roamye, a third possible solution was discussed (and proven). It would have us optimize the current CTS approach by moving some of the criteria within the call to cts.triples. In this case, it meant we were no longer asking cts.triples to return over 9 million values. Note it is not necessarily a straightforward optimization, but is one we can consider.