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

Copy Markdown View Source

Removes a document from the inverted index.

Deletes all term entries for a post from both search_post_terms and search_post_fields.

Summary

Functions

Deletes all index entries for a post across all fields.

Deletes all index entries for a specific field of a post.

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.

First reads the terms from search_post_fields so we know which partition keys to target for deletion in search_post_terms. Then deletes from both tables.

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

delete_field(repo, keyspace, post_id, field)

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

Deletes all index entries for a specific field of a post.