[{"data":1,"prerenderedAt":298},["ShallowReactive",2],{"page-\u002Fconcepts\u002Franking":3},{"id":4,"title":5,"body":6,"description":290,"extension":291,"meta":292,"navigation":293,"path":294,"seo":295,"stem":296,"__hash__":297},"content\u002F3.concepts\u002F1.ranking.md","Ranking",{"type":7,"value":8,"toc":280},"minimark",[9,14,23,27,46,97,101,104,135,149,153,177,181,250,254,267,271,276],[10,11,13],"h2",{"id":12},"_1-words-become-a-safe-query","1. Words become a safe query",[15,16,17,18,22],"p",{},"The text is split into words of letters and digits, lower-cased, and capped at 12 words. Each word is written as a quoted TINQL term, so user input can never add query operators. The TINQL that ran is returned in ",[19,20,21],"code",{},"geocoding.query.tinql",".",[10,24,26],{"id":25},"_2-all-words-first-then-most-of-them","2. All words first, then most of them",[15,28,29,30,33,34,37,38,41,42,45],{},"Every word is required first. If that finds fewer than ",[19,31,32],{},"size"," places, the query relaxes to about three quarters of the words (rounded up), written as an ",[19,35,36],{},"OR"," of ",[19,39,40],{},"AND"," groups, or as ",[19,43,44],{},"AT LEAST n OF [...]"," when there would be too many groups.",[47,48,49,62],"table",{},[50,51,52],"thead",{},[53,54,55,59],"tr",{},[56,57,58],"th",{},"Words",[56,60,61],{},"Required after relaxing",[63,64,65,74,82,89],"tbody",{},[53,66,67,71],{},[68,69,70],"td",{},"1–3",[68,72,73],{},"all",[53,75,76,79],{},[68,77,78],{},"4",[68,80,81],{},"3",[53,83,84,87],{},[68,85,86],{},"5",[68,88,78],{},[53,90,91,94],{},[68,92,93],{},"8",[68,95,96],{},"6",[10,98,100],{"id":99},"_3-text-score-plus-importance","3. Text score plus importance",[15,102,103],{},"Rows are ordered by",[105,106,111],"pre",{"className":107,"code":108,"language":109,"meta":110,"style":110},"language-sql shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","tin.score(ctid) + importance * IMPORTANCE_WEIGHT\n","sql","",[19,112,113],{"__ignoreMap":110},[114,115,118,122,126,129,132],"span",{"class":116,"line":117},"line",1,[114,119,121],{"class":120},"sTEyZ","tin.score(ctid) ",[114,123,125],{"class":124},"sMK4o","+",[114,127,128],{"class":120}," importance ",[114,130,131],{"class":124},"*",[114,133,134],{"class":120}," IMPORTANCE_WEIGHT\n",[15,136,137,140,141,144,145,148],{},[19,138,139],{},"tin.score"," is the BM25 text score and ",[19,142,143],{},"importance"," is a 0–1 value from the geolith build. The default weight is ",[19,146,147],{},"10",". This order is computed inside the TIN index, so a top 10 does not sort every match.",[10,150,152],{"id":151},"_4-focus-points","4. Focus points",[15,154,155,156,159,160,163,164,166,167,169,170,173,174,22],{},"With ",[19,157,158],{},"focus.point.lat"," and ",[19,161,162],{},"focus.point.lon",", boxes of ±0.05°, ±0.25° and ±0.5° around the point are searched in that order. The search stops at the first box that holds ",[19,165,32],{}," places. Each result then gets a distance boost of up to +5 that halves every 10 km, and places inside the largest box come before the rest. If the boxes hold fewer than ",[19,168,32],{}," places, the global ranking fills the list. ",[19,171,172],{},"geocoding.query.ranking"," is then ",[19,175,176],{},"importance+distance",[10,178,180],{"id":179},"_5-every-query-has-a-budget","5. Every query has a budget",[47,182,183,196],{},[50,184,185],{},[53,186,187,190,193],{},[56,188,189],{},"Query",[56,191,192],{},"Budget",[56,194,195],{},"When it runs out",[63,197,198,212,233],{},[53,199,200,203,209],{},[68,201,202],{},"Focus boxes",[68,204,205,208],{},[19,206,207],{},"FOCUS_TIMEOUT_MS"," (1000), shared by all boxes",[68,210,211],{},"Keeps the rows of the smaller boxes",[53,213,214,217,223],{},[68,215,216],{},"Importance-ranked",[68,218,219,222],{},[19,220,221],{},"RANKED_TIMEOUT_MS"," (250)",[68,224,225,226,229,230],{},"Falls back to text score only; ",[19,227,228],{},"ranking"," becomes ",[19,231,232],{},"text",[53,234,235,238,244],{},[68,236,237],{},"Text-only fallback",[68,239,240,243],{},[19,241,242],{},"FALLBACK_TIMEOUT_MS"," (2000)",[68,245,246,247],{},"Returns focus rows if any, else ",[19,248,249],{},"504",[10,251,253],{"id":252},"_6-autocomplete","6. Autocomplete",[15,255,256,257,260,261,266],{},"The last word matches as a prefix (",[19,258,259],{},"par*","). See ",[262,263,265],"a",{"href":264},"\u002Fapi\u002Fautocomplete","Autocomplete"," for the details.",[10,268,270],{"id":269},"confidence","Confidence",[15,272,273,275],{},[19,274,269],{}," is the share of query words found in the place's text, from 0 to 1. With autocomplete, the last word counts when a word starts with it.",[277,278,279],"style",{},"html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":110,"searchDepth":281,"depth":281,"links":282},2,[283,284,285,286,287,288,289],{"id":12,"depth":281,"text":13},{"id":25,"depth":281,"text":26},{"id":99,"depth":281,"text":100},{"id":151,"depth":281,"text":152},{"id":179,"depth":281,"text":180},{"id":252,"depth":281,"text":253},{"id":269,"depth":281,"text":270},"How text relevance, importance, focus points and time budgets decide the order of results.","md",{},true,"\u002Fconcepts\u002Franking",{"title":5,"description":290},"3.concepts\u002F1.ranking","dzlC60YOo_1FYwdstuUgsBRp6r0FbgzRVWHNuED20OM",1791345919738]