rust/tests/rustdoc-js
Michael Howell 0ea58e2346 rustdoc-search: count path edits with separate edit limit
Since the two are counted separately elsewhere, they should get
their own limits, too. The biggest problem with combining them
is that paths are loosely checked by not requiring every component
to match, which means that if they are short and matched loosely,
they can easily find "drunk typist" matches that make no sense,
like this old result:

    std::collections::btree_map::itermut matching slice::itermut
    maxEditDistance = ("slice::itermut".length) / 3 = 14 / 3 = 4
    editDistance("std", "slice") = 4
    editDistance("itermut", "itermut") = 0
        4 + 0 <= 4 PASS

Of course, `slice::itermut` should not match stuff from btreemap.
`slice` should not match `std`.

The new result counts them separately:

    maxPathEditDistance = "slice".length / 3 = 5 / 3 = 1
    maxEditDistance = "itermut".length / 3 = 7 / 3 = 2
    editDistance("std", "slice") = 4
        4 <= 1 FAIL

Effectively, this makes path queries less "typo-resistant".
It's not zero, but it means `vec` won't match the `v1` prelude.

Queries without parent paths are unchanged.
2023-12-26 18:46:17 -07:00
..
auxiliary
assoc-type-backtrack.js rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
assoc-type-backtrack.rs rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
assoc-type-loop.js rustdoc-search: avoid infinite where clause unbox 2023-11-24 10:42:11 -07:00
assoc-type-loop.rs rustdoc-search: avoid infinite where clause unbox 2023-11-24 10:42:11 -07:00
assoc-type.js rustdoc-search: use set ops for ranking and filtering 2023-12-13 10:37:15 -07:00
assoc-type.rs rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
basic.js
basic.rs
big-result.js rustdoc-search: use set ops for ranking and filtering 2023-12-13 10:37:15 -07:00
big-result.rs rustdoc-search: use set ops for ranking and filtering 2023-12-13 10:37:15 -07:00
doc-alias-filter-out.js
doc-alias-filter-out.rs
doc-alias-filter.js
doc-alias-filter.rs
doc-alias-whitespace.js
doc-alias-whitespace.rs
doc-alias.js
doc-alias.rs
enum-variant-not-type.js rustdoc-search: do not treat associated type names as types 2023-12-10 16:52:21 -07:00
enum-variant-not-type.rs rustdoc-search: do not treat associated type names as types 2023-12-10 16:52:21 -07:00
exact-match.js rustdoc-search: count path edits with separate edit limit 2023-12-26 18:46:17 -07:00
exact-match.rs
foreign-type-path.js
foreign-type-path.rs
full-path-function.js rustdoc-search: use set ops for ranking and filtering 2023-12-13 10:37:15 -07:00
full-path-function.rs
gat.js rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
gat.rs rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
generics2.js
generics2.rs
generics-impl.js
generics-impl.rs
generics-match-ambiguity.js
generics-match-ambiguity.rs
generics-multi-trait.js
generics-multi-trait.rs
generics-nested.js
generics-nested.rs
generics-trait.js
generics-trait.rs
generics-unbox.js
generics-unbox.rs
generics.js rustdoc-search: use set ops for ranking and filtering 2023-12-13 10:37:15 -07:00
generics.rs
impl-trait.js rustdoc-search: use set ops for ranking and filtering 2023-12-13 10:37:15 -07:00
impl-trait.rs
macro-search.js
macro-search.rs
module-substring.js rustdoc-search: count path edits with separate edit limit 2023-12-26 18:46:17 -07:00
module-substring.rs
nested-unboxed.js
nested-unboxed.rs
never-search.js rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
never-search.rs
path-maxeditdistance.js rustdoc-search: count path edits with separate edit limit 2023-12-26 18:46:17 -07:00
path-maxeditdistance.rs rustdoc-search: count path edits with separate edit limit 2023-12-26 18:46:17 -07:00
path-ordering.js rustdoc-search: count path edits with separate edit limit 2023-12-26 18:46:17 -07:00
path-ordering.rs rustdoc-search: count path edits with separate edit limit 2023-12-26 18:46:17 -07:00
primitive.js
primitive.rs
prototype.js
prototype.rs
raw-pointer.js
raw-pointer.rs
reexport.js
reexport.rs
search-bag-semantics.js
search-bag-semantics.rs
search-method-disambiguate.js
search-method-disambiguate.rs
search-non-local-trait-impl.js
search-non-local-trait-impl.rs
search-short-types.js
search-short-types.rs
slice-array.js
slice-array.rs
struct-like-variant.js
struct-like-variant.rs
substring.js rustdoc-search: remove parallel searchWords array 2023-12-15 16:26:35 -07:00
substring.rs rustdoc-search: remove parallel searchWords array 2023-12-15 16:26:35 -07:00
summaries.js
summaries.rs
trait-methods.js rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
trait-methods.rs rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
type-parameters.js rustdoc-search: use set ops for ranking and filtering 2023-12-13 10:37:15 -07:00
type-parameters.rs
where-clause.js
where-clause.rs