Scrypath.Meilisearch.FederatedDecode (scrypath v0.3.3)

Copy Markdown View Source

Decodes federated /multi-search responses into per-index raw maps suitable for building the public search result structs returned from Scrypath.search/3.

Federated responses carry a flat hits list tagged with _federation.indexUid and optional facetsByIndex keyed by index UID. This module never calls String.to_atom/1 on remote keys.

Summary

Functions

Returns {:ok, [{schema, raw_map}]} aligned to indexed_schemas declaration order.

Functions

per_schema_maps(response, indexed_schemas)

@spec per_schema_maps(map(), [{module(), String.t()}]) ::
  {:ok, [{module(), map()}]} | {:error, term()}

Returns {:ok, [{schema, raw_map}]} aligned to indexed_schemas declaration order.

indexed_schemas is [{schema_module, index_uid_string}, ...].