Semantic search through PDF without defined number of results desired

Hi, I’m trying to do semantic search with results given back by relevance rather than a number (like a KNN would). I see we can sort result by relevance (https://community.palantir.com/t/can-i-display-ordered-results-in-workshop-from-a-semantic-search-function/235) but still need a number of expected results.
I’m considering using a ranking function with a threshold experimentally set instead, would anyone have guidance/known pitfalls/heuristics?
Thanks!