Skip to content

Optional serde feature for SearchResults #82

@Fieldnote-Echo

Description

@Fieldnote-Echo

Summary

Add an optional, default-off serde feature that derives Serialize/Deserialize for SearchResults.

SearchResults holds flat Vec<f32> / Vec<i64> + two usize (src/lib.rs:112) — trivially serializable. Behind a feature gate this lets callers log results, cache them (Redis), put them on a message queue, or pipe them to a downstream ranker without writing their own serializer.

Notes

  • Zero impact on the default build — no new default dependency.
  • docs.rs already builds default-features-only, so this stays off the published docs surface.
  • Keep it scoped to SearchResults for now (not the index types — their formats are the .tvr* file magics, which already have write/load).

Acceptance

  • serde optional feature, off by default
  • cargo build / cargo test unchanged without the feature
  • Round-trip test under --features serde

Filed from an external technical review (May 2026); verified against v0.2.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions