AshScylla.Search.Indexer.Deleter (AshScylla v1.9.0)

Copy Markdown View Source

Removes a document from the inverted index.

Deletes all posting rows for a post from search_post_terms and its field maps from search_post_fields.

Summary

Functions

Deletes all index entries for a post across all fields.

Removes a single field from the index for a document.

Functions

delete(repo, keyspace, post_id)

@spec delete(module(), String.t(), String.t()) :: :ok | {:error, term()}

Deletes all index entries for a post across all fields.

Reads the stored field maps so we know which term partitions to target, deletes the postings, then deletes the stored field rows.

Returns :ok on success or {:error, reason} on failure.

delete_field(repo, keyspace, post_id, field_name)

@spec delete_field(module(), String.t(), String.t(), atom() | String.t()) ::
  :ok | {:error, term()}

Removes a single field from the index for a document.

Document-level postings are recomputed: terms that only this field contributed are deleted; shared terms have their totals lowered. The field's stored map row is removed.