Search hints come back in a different order #49
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Search hints come back in a different order.
/Search/Hints?searchTerm=alienover a production library — both servers findthe same seven items and neither misses one, but the order differs:
Upstream leads with the exact match and ranks by how well the term matches.
Ours appears to group by type and sort within it, so the film called
Aliencomes fourth behind three episodes that merely contain the word.
Array order is contract, and this is the one route where the order is the
answer: a search box shows the first few.
The reference library is too small for a term to match seven things, so no
scenario has ever ordered more than one hit.
/Search/Hintsis two queries, and this port was doing neither.SqlSearchProviderscores every row whose foldedCleanNameholds the term,first arm winning:
term + " ")80 beats 75, so
SkyfalloutranksAbove Sky Line; and a name ending in theterm scores 50, not 75 — no trailing space — which is why upstream puts
The Matrixlast formatrix. It cuts withscore DESC, id ASCatlimit ?? 100, thenSearchManagerre-reads those ids ordered bySortNameand stably re-sorts by score. Net: score DESC, SortName ASC, and the cut
happens before paging, so
TotalRecordCountis the capped count.alienmatrixlove&limit=8star&limit=12128 of 128 request variants are now byte-identical to upstream — 28 terms
across bare, limited, paged, and type-filtered forms. Before, nearly all
differed. Also fixed here:
Year,FolderandCollectionFolderare excludedas upstream excludes them, a whitespace-only term is a 400 rather than the whole
library, and a term that folds to nothing matches nothing.
One existing test asserted
total=2forlimit=1. That was this port's ownanswer, not upstream's — verified live,
alien&limit=1counts 1.Two separate defects found and deliberately not fixed here:
/Search/Hintsignores
parentId, andOriginalTitleis never matched. Both filed.