Index management coordinator.
Orchestrates indexing, updating, and deleting documents in the inverted index.
Delegates to Builder, Updater, and Deleter sub-modules.
Usage
# Index a new document
Indexer.index(repo, keyspace, post_id, %{title: "Hello World", body: "Elixir is great"})
# Update a document
Indexer.update(repo, keyspace, post_id, %{title: "Updated Title", body: "New content"})
# Delete a document
Indexer.delete(repo, keyspace, post_id)
Summary
Functions
Removes a document entirely from the inverted index.
Removes a single field from the index for a document.
Indexes a new document into the inverted index.
Updates a document's indexed terms.
Types
Functions
Removes a document entirely from the inverted index.
@spec delete_field(module(), String.t(), String.t(), non_neg_integer()) :: :ok | {:error, term()}
Removes a single field from the index for a document.
Indexes a new document into the inverted index.
Accepts a map of field names to text values. Each field is:
- Analyzed (tokenized, normalized, stemmed)
- Written to
search_post_termsandsearch_post_fields
Fields are numbered sequentially starting from 0 in the order they appear in the map.
Returns :ok on success or {:error, reason} on failure.
Updates a document's indexed terms.
For each field, computes the diff between old stored terms and new analyzed terms, then applies only the necessary inserts and deletes.
Fields that haven't changed are left untouched.