AAPB2 icon indicating copy to clipboard operation
AAPB2 copied to clipboard

Use solr '?' wildcard to resolve /catalog/:id and /api/:id routes

Open foglabs opened this issue 1 year ago • 0 comments

Because

Because we currently resolve different guid styles by sequentially checking -, _, and then / guid variations on /catalog/:id until we find a match in solr, we can save ourselves from making multiple solr searches per request by subbing the cpb-aacip-/etc portion of the id param with cpb-aacip?, and searching solr once for this value.

The /api/:id route currently does not account for guid variations, so this same ? fix can be applied to the api route to correctly handle guid styles on the api.

The AAPB search index fundamentally should not contain separate records for different styles of the same guid, so this fix should allow for the correct behavior across all routes with less hittin' of solr.

Done when

API and Catalog routes handle guid variations with only one solr search required

Additional context

No response

foglabs avatar Aug 15 '24 19:08 foglabs