Contribution Date
Contribution Project
Contribution Details
Add damrs_search_api, completing the connector
A Search API backend that proxies queries to damrs rather than indexing the
library into Drupal. That is the design and not a shortcut. Search API's usual
shape is index-then-query, and a local copy would make every rights decision be
taken against it: an asset whose licence lapsed, or whose access changed, would
keep appearing in results until the next reindex. Keeping rights authoritative
in the DAM is the whole argument for this connector, and an indexed copy quietly
undoes it.
So indexItems() stores nothing and says so. Returning the ids would tell Search
API's tracker these items are indexed and searchable here, which is a lie that
surfaces later as results that never appear.
/browse rather than /search, because it answers with the results and the facet
rail from one call, counted over the same query — one round trip instead of one
per facet block, and a facet cannot claim forty while the grid beside it shows
three.
Three refusals are pinned by tests:
- Paging past damrs's depth cap raises rather than returning an empty page,
which would be indistinguishable from "no more results" and would leave a
view showing a blank grid with paging that appears to work.
- An unreachable damrs empties the results and attaches a warning rather than
throwing. This backend can sit behind a block on every page of a site; a
search box that returns nothing is recoverable and a white screen is not.
- Clearing the Drupal index must not contact damrs at all. A site clearing its
search index has not asked to empty somebody's asset library, and a backend
reading it that way would turn an ordinary administrative action into a
catastrophe.
One thing running it caught immediately: BackendPluginBase already declares
$fieldsHelper, so promoting a readonly property of the same name is a fatal
error rather than an override. It comes through the base class's setter instead.
CI installs the contrib search_api so this suite runs there rather than only on
a laptop. That is the sixth and last submodule: M3d·5 is complete.
Contribution Issue Link
Files count
0
Patches count
1