Index management coordinator.
Orchestrates indexing, updating, and deleting documents in the inverted index.
Delegates to Builder, Updater, and Deleter sub-modules.
Fields are identified by name, so partial updates only ever touch the fields present in the given map. Postings are stored at document level: a term shared across fields is stored once with its summed frequency, and updates recompute those totals from the per-field maps.
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. Shared terms keep their contributions from remaining fields.
Indexes a new document into the inverted index.
Updates a document's indexed terms.
Types
Functions
Removes a document entirely from the inverted index.
Removes a single field from the index for a document. Shared terms keep their contributions from remaining fields.
Indexes a new document into the inverted index.
Accepts a map of field names to text values. Each field is analyzed (tokenized, normalized, stemmed); the per-field maps are aggregated into document-level postings and written in a single batch.
Returns :ok on success or {:error, reason} on failure.
Updates a document's indexed terms.
Reads the stored per-field maps, applies the newly analyzed text for every field present in the map, recomputes document-level totals, and writes only the changed postings. Fields omitted from the map are left untouched.