lsh

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const SetDedup = "lsh_dedup"

SetDedup is the set name for LSH dedup storage.

View Source
const SetVector = "lsh_vector"

SetVector is the set name for LSH vector storage.

Variables

This section is empty.

Functions

func DeleteDedup

func DeleteDedup(ctx context.Context, c queries.Client, req DedupRequest, src queries.Source) error

DeleteDedup removes the LSH dedup bucket entry for the given reference value. The server stores dedup data under the namespace with the reference value as key.

func DeleteVector

func DeleteVector(ctx context.Context, c queries.Client, req VectorRequest, src queries.Source) error

DeleteVector removes the LSH vector bucket entry for the given attribute vector.

Types

type DedupRequest

type DedupRequest struct {
	Namespace string        // FrogoDB namespace for LSH index
	Reference string        // source key for reference value (e.g., "standard.email")
	TTL       time.Duration // REQUIRED. Expiration for LSH bucket entries.
}

DedupRequest describes an LSH string deduplication query.

func (DedupRequest) Validate

func (r DedupRequest) Validate() error

Validate checks that required fields are set.

type DedupResult

type DedupResult struct {
	BucketID string // LSH bucket identifier
}

DedupResult holds the outcome of an LSH deduplication query.

func Dedup

Dedup performs an LSH string deduplication query. It extracts the reference value from the source, sends it to the FrogoDB LSH dedup service, and returns the bucket ID.

Flow:

  1. value = src.String(req.Reference)
  2. Send OpLSHDedup to FrogoDB with value
  3. Server computes LSH hash -> bucket_id
  4. Return DedupResult{BucketID: bucketID}

type VectorRequest

type VectorRequest struct {
	Namespace  string        // FrogoDB namespace for vector LSH index
	Attributes []string      // ordered source keys for vector components
	TTL        time.Duration // REQUIRED. Expiration for vector LSH bucket entries.
}

VectorRequest describes an LSH vector query for behavioural clustering.

func (VectorRequest) Validate

func (r VectorRequest) Validate() error

Validate checks that required fields are set.

type VectorResult

type VectorResult struct {
	BehavioralID string // LSH bucket identifier for this behavior vector
}

VectorResult holds the outcome of an LSH vector query.

func Vector

Vector performs an LSH vector query. It extracts ordered attribute floats from the source, forms a vector, sends it to the FrogoDB LSH vector service, and returns the behavioural ID.

Flow:

  1. vec[i] = src.Float(req.Attributes[i]) for each attribute
  2. Send OpLSHVector to FrogoDB with vector bytes
  3. Server computes vector LSH -> behavioral_id
  4. Return VectorResult{BehavioralID: id}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL