Rank a category name above an accidental substring in the palette #367

Merged
jaylouisw merged 1 commit from fix/palette-category-rank into main 2026-11-08 06:58:17 +00:00
Owner

Typing the name of a device class did not find that class.

ont is this project's own word for fibre CPE, and it is also a substring of Controller. So the first three results for ont were an Aruba 7210 Mobility Controller, an ExtremeCloud IQ Controller and an FL SWITCH 2008 — with every actual ONT behind them. modem led with three FRITZ!Box/Cradlepoint routers. olt put a Konica Minolta bizhub printer third.

The cause was the ranking: any model substring scored 2, the category scored 4, so an accident of spelling outranked a name someone chose deliberately.

Tiers are now exact model → model prefix → category word → model substring → vendor+model → other field → all tokens, with a whole-word test on the raw string before folding, so on-t still means ont and monitor is not an ont hit.

Measured on the same catalogue, before and after, with result counts unchanged (274 / 84 / 75) — only the order moved:

query before after
ont 7210 Mobility Controller(host), ExtremeCloud IQ Controller(host), FL SWITCH 2008(switch) 411(ont), SDX611(ont), SDX 621(ont)
modem FRITZ!Box 7590(router), E3000(router), R1900(router) S33(modem), SB8200(modem), CM8200(modem)
olt UF-OLT-4(olt), UF-OLT(olt), bizhub C360i(printer) SDX 6312-4(olt), SDX 6320(olt), SDX 6330(olt)

Same counts matters: the fix reorders, it does not filter, so nothing that was findable has become unreachable. Verified in a browser against the running server as well as in tests.

Nothing was made fuzzy — a transposed SKU still returns nothing and mc-220l still finds MC220L first. test/palette-category-rank.test.js covers the synthetic shape of the bug, the word-boundary rule, prefix-above-category ordering, all eight real category names, and the anti-fuzzy guarantees. 87 suites, 4298 assertions.

Typing the name of a device class did not find that class. `ont` is this project's own word for fibre CPE, and it is also a substring of `Controller`. So the first three results for **ont** were an Aruba 7210 Mobility Controller, an ExtremeCloud IQ Controller and an FL SWITCH 2008 — with every actual ONT behind them. **modem** led with three FRITZ!Box/Cradlepoint *routers*. **olt** put a Konica Minolta bizhub printer third. The cause was the ranking: any model substring scored 2, the category scored 4, so an accident of spelling outranked a name someone chose deliberately. Tiers are now exact model → model prefix → **category word** → model substring → vendor+model → other field → all tokens, with a whole-word test on the raw string before folding, so `on-t` still means `ont` and `monitor` is not an `ont` hit. Measured on the same catalogue, before and after, **with result counts unchanged** (274 / 84 / 75) — only the order moved: | query | before | after | |---|---|---| | ont | 7210 Mobility Controller(host), ExtremeCloud IQ Controller(host), FL SWITCH 2008(switch) | 411(ont), SDX611(ont), SDX 621(ont) | | modem | FRITZ!Box 7590(router), E3000(router), R1900(router) | S33(modem), SB8200(modem), CM8200(modem) | | olt | UF-OLT-4(olt), UF-OLT(olt), bizhub C360i(printer) | SDX 6312-4(olt), SDX 6320(olt), SDX 6330(olt) | Same counts matters: the fix reorders, it does not filter, so nothing that was findable has become unreachable. Verified in a browser against the running server as well as in tests. Nothing was made fuzzy — a transposed SKU still returns nothing and `mc-220l` still finds MC220L first. `test/palette-category-rank.test.js` covers the synthetic shape of the bug, the word-boundary rule, prefix-above-category ordering, all eight real category names, and the anti-fuzzy guarantees. 87 suites, 4298 assertions.
Rank a category name above an accidental substring in the palette
Some checks failed
CI / Test (Node 18) (pull_request) Successful in 1m31s
CI / Test (Node 20) (pull_request) Successful in 1m21s
CI / Test (Node 22) (pull_request) Successful in 1m19s
CI / Server smoke test (pull_request) Successful in 36s
CI / Docker build (pull_request) Failing after 12s
b9b899b1f9
Typing the name of a device class did not find that class. 'ont' is this project's own word for fibre CPE, and it is also a substring of 'Controller', so the first three results for 'ont' were an Aruba 7210 Mobility Controller, an ExtremeCloud IQ Controller and an FL SWITCH 2008, with every actual ONT behind them. 'modem' led with three FRITZ!Box and Cradlepoint *routers*; 'olt' put a Konica Minolta bizhub printer third.

The cause was the ranking itself: any model substring scored 2 and the category scored 4, so an accident of spelling outranked a name someone chose deliberately. The tiers are now exact model, model prefix, category word, model substring, vendor+model, other field, all tokens - with a whole-word test on the raw string before folding, so 'on-t' still means 'ont' and 'monitor' does not count as an 'ont' hit.

Measured on the same catalogue, before and after, with the result counts unchanged (274 for 'ont', 84 for 'modem', 75 for 'olt') - only the order moved:
  ont    before: 7210 Mobility Controller(host), ExtremeCloud IQ Controller(host), FL SWITCH 2008(switch)
         after:  411(ont), SDX611(ont), SDX 621(ont)
  modem  before: FRITZ!Box 7590(router), E3000(router), R1900(router)
         after:  S33(modem), SB8200(modem), CM8200(modem)
  olt    before: UF-OLT-4(olt), UF-OLT(olt), bizhub C360i(printer)
         after:  SDX 6312-4(olt), SDX 6320(olt), SDX 6330(olt)

Same counts matters: the fix reorders, it does not filter, so nothing that used to be findable has become unreachable. Verified in a browser against the running server as well as in the tests.

Nothing was made fuzzy. A transposed SKU still returns nothing, and 'mc-220l' still finds MC220L first. test/palette-category-rank.test.js covers the synthetic shape of the bug, the word-boundary rule, the prefix-above-category ordering, all eight real category names, and the anti-fuzzy guarantees. 87 suites, 4298 assertions.
jaylouisw force-pushed fix/palette-category-rank from b9b899b1f9
Some checks failed
CI / Test (Node 18) (pull_request) Successful in 1m31s
CI / Test (Node 20) (pull_request) Successful in 1m21s
CI / Test (Node 22) (pull_request) Successful in 1m19s
CI / Server smoke test (pull_request) Successful in 36s
CI / Docker build (pull_request) Failing after 12s
to 0b07224fc1
Some checks failed
CI / Test (Node 18) (pull_request) Successful in 1m10s
CI / Test (Node 20) (pull_request) Successful in 1m6s
CI / Test (Node 22) (pull_request) Successful in 1m2s
CI / Server smoke test (pull_request) Successful in 22s
CI / Docker build (pull_request) Failing after 11s
2026-11-08 06:40:27 +00:00
Compare
jaylouisw deleted branch fix/palette-category-rank 2026-11-08 06:58:18 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!367
No description provided.