Add functionality to search on an iterable of references. - #21
Merged
Merged
Conversation
search result (closes #18)
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Searching collections other than slices, and a derive macro for
Fuseable.Added
search_text_in_fuseable_refssearches any iterable ofFuseablereferences — aHashSet, the values of aHashMap, aBTreeMap, aVec— with no intermediatecopy 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_rayonandsearch_text_in_fuseable_refs_with_chunk_size, therayonandasyncequivalents.FuseableRefSearchResult, the result type those return.impl Fuseable for &T, so&[&Book]works wherever&[Book]did.derivefeature, re-exporting#[derive(Fuseable)]from the newfuse-rust-derivecrate. Mark searchable fields with#[fuse], or#[fuse(weight = 0.3)]to weigh them; unmarked fields are ignored.FusePropertynow derivesDebugandPartialEq, like the other result types.Fixed
0, so withchunk_size: 1every result claimed index0.0.001floor applied to an exact match on a full-weight property, so the same inputproduced different scores depending on which entry point you called.
Changed
Fuseableentry point, sothe sequential, chunked and reference-returning paths cannot drift apart again.
synto 3,icedto 0.14 in the search-bar example, and refreshed the lockfile.Breaking
impl Fuseable for &Tconflicts with a hand-writtenimpl Fuseable for &LocalTypewhereLocalType: Fuseable. Delete the hand-writtenimpl if you have one.
search_text_in_fuse_list_with_chunk_sizeandsearch_text_in_fuse_list_with_chunk_size_rayonhave changed. Both were bugs; thechunked results now match the sequential search exactly.