Skip to content

Add functionality to search on an iterable of references. - #21

Merged
Blakeinstein merged 6 commits into
masterfrom
feat/ref-search
Sep 22, 2026
Merged

Blakeinstein merged 6 commits into
masterfrom
feat/ref-search

Conversation

@Blakeinstein

Copy link
Copy Markdown
Owner

Searching collections other than slices, and a derive macro for Fuseable.

Added

  • search_text_in_fuseable_refs searches any iterable of Fuseable references — a
    HashSet, the values of a HashMap, a BTreeMap, a Vec — with no intermediate
    copy of the collection. Results borrow the matched item, so there is no index to map
    back to an unordered collection. Closes #18.
  • search_text_in_fuseable_refs_with_chunk_size_rayon and
    search_text_in_fuseable_refs_with_chunk_size, the rayon and async equivalents.
  • FuseableRefSearchResult, the result type those return.
  • A blanket impl Fuseable for &T, so &[&Book] works wherever &[Book] did.
  • An optional derive feature, re-exporting #[derive(Fuseable)] from the new
    fuse-rust-derive crate. Mark searchable fields with #[fuse], or
    #[fuse(weight = 0.3)] to weigh them; unmarked fields are ignored.
  • FuseProperty now derives Debug and PartialEq, like the other result types.

Fixed

  • Chunked searches reported chunk-local indices: every chunk restarted at 0, so with
    chunk_size: 1 every result claimed index 0.
  • Chunked searches scored differently from the sequential search. They omitted the
    0.001 floor applied to an exact match on a full-weight property, so the same input
    produced different scores depending on which entry point you called.

Changed

  • The scoring core now lives in one place, shared by every Fuseable entry point, so
    the sequential, chunked and reference-returning paths cannot drift apart again.
  • Bumped syn to 3, iced to 0.14 in the search-bar example, and refreshed the lockfile.

Breaking

  • The blanket impl Fuseable for &T conflicts with a hand-written
    impl Fuseable for &LocalType where LocalType: Fuseable. Delete the hand-written
    impl if you have one.
  • Indices and scores returned by search_text_in_fuse_list_with_chunk_size and
    search_text_in_fuse_list_with_chunk_size_rayon have changed. Both were bugs; the
    chunked results now match the sequential search exactly.

Adds reference-based search over arbitrary iterables, a derive macro for
Fuseable behind the new `derive` feature, and fixes the chunked
searches'
indices and scoring.
Enabling the async feature surfaced a doc_lazy_continuation warning that CI
never linted, since the job ran with default features only.
@Blakeinstein
Blakeinstein merged commit 292d81d into master Sep 22, 2026
8 checks passed
@Blakeinstein
Blakeinstein deleted the feat/ref-search branch September 22, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request] search through iterable Fuseable

1 participant