Commit 82127d5
committed
feat(search): the URL leads, but only for the words it adds
Element order is now URL > keywords > title > header > emphasis > body.
The URL leads because a path is two to four words and a human chose every one —
the argument that makes a title strong, applied to something terser. But only for
the words it ADDS. A blog slug is generated from the title, so
/blog/imqueue-vs-moleculer/ matching "imqueue" is the title matching twice; at the
top weight that would quietly mean "titles count double" and demote every other
element to pay for it. So urlScore splits: a term in the path AND the title is an
echo worth less than the title it repeats (110), a term in the path and NOT in the
title takes the top weight (480). /mcp/installation/ is titled "Add the MCP server
to Claude, Cursor & VS Code" — "installation" exists nowhere on that page but its
path, which is the case worth leading with.
The reported symptom had nothing to do with weight, though. urlScore required a
query term to EQUAL a path segment, so "installation mcp" ranked that page #1 and
"install mcp" could not find it at all — one element doing exact string equality
while every other element in the ranker matches substrings. A term is now credited
when it equals a segment, is its lemma, or is a prefix of it from 5 characters up.
keywords moves from 300 to 450, above title. At that weight the difference between
"one of my declared phrases IS what you typed" and "your words appear somewhere in
my list" is the whole value of the element, and without it the promotion did real
damage: four blog comparison pages whose lists merely contain "imqueue" pushed the
home page's own "What @imqueue is" heading from #1 to #9. A declared phrase now
takes the full 450, word overlap takes 270 — near where the element sat before.
/intro/ replaces / as the expected #1 for "what is imqueue", and it is a decision
rather than a drift: /intro/ declares that literal phrase in its keywords and its
title answers the question in a sentence. The home page is #2. The failure that
case was written for is guarded by the stopword and bagScore checks, not by which
of those two pages comes first.
covers() now sees the path for exactly the records urlScore will score, and not
for the API records it returns 0 on. Yesterday's bug was a floor rejecting what
the scorer would have ranked first; crediting a path the scorer ignores is the
same bug mirrored.
how to install mcp #5 -> #1
install mcp absent from the top -> #1
what is imqueue /intro/ #1, / #2 (was / #1, /intro/ #2)
imqueue vs moleculer its own article still #1 — no slug double count
Also fixes a stale comment: the keywords element claimed to sit "BELOW emphasis
deliberately" while its value was 300 and emphasis was 200.
Full suite green on both editions; six new ranking checks.1 parent 309c052 commit 82127d5
2 files changed
Lines changed: 177 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
65 | 72 | | |
66 | | - | |
| 73 | + | |
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
| |||
575 | 582 | | |
576 | 583 | | |
577 | 584 | | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
578 | 644 | | |
579 | 645 | | |
580 | 646 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
100 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
101 | 127 | | |
102 | 128 | | |
103 | 129 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
111 | 133 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | 134 | | |
120 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
121 | 152 | | |
122 | 153 | | |
123 | 154 | | |
| |||
858 | 889 | | |
859 | 890 | | |
860 | 891 | | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
861 | 907 | | |
862 | 908 | | |
863 | 909 | | |
| |||
878 | 924 | | |
879 | 925 | | |
880 | 926 | | |
881 | | - | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
882 | 933 | | |
883 | 934 | | |
884 | 935 | | |
885 | | - | |
| 936 | + | |
| 937 | + | |
886 | 938 | | |
887 | | - | |
888 | | - | |
889 | | - | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
890 | 942 | | |
891 | 943 | | |
892 | 944 | | |
| |||
899 | 951 | | |
900 | 952 | | |
901 | 953 | | |
902 | | - | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
903 | 957 | | |
904 | 958 | | |
905 | 959 | | |
906 | | - | |
| 960 | + | |
907 | 961 | | |
908 | 962 | | |
909 | | - | |
910 | | - | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
911 | 972 | | |
912 | 973 | | |
913 | 974 | | |
914 | | - | |
915 | | - | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
916 | 984 | | |
917 | 985 | | |
918 | 986 | | |
919 | | - | |
| 987 | + | |
920 | 988 | | |
921 | 989 | | |
922 | 990 | | |
923 | | - | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
924 | 994 | | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
925 | 1000 | | |
926 | | - | |
| 1001 | + | |
927 | 1002 | | |
928 | 1003 | | |
929 | 1004 | | |
| |||
975 | 1050 | | |
976 | 1051 | | |
977 | 1052 | | |
978 | | - | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
979 | 1060 | | |
980 | 1061 | | |
981 | 1062 | | |
| |||
0 commit comments