omnidoes / topperstation

MIT License
0 stars 0 forks source link

Exclude Brightcove videos from search indexing when "status" is inactive. #72

Open aaronlsilber opened 5 years ago

aaronlsilber commented 5 years ago

Brightcove syncs inactive videos to the site, which means that they can't be played. We're excluding these inactive videos from views on the site, but they're showing up in search results because Search API checks the 'Entity status' and not the custom status field on the Brightcove entity.

I'm not sure if there is a contrib module for excluding content from indexing based on a field value, but there are custom ways to do this using a Plugin;

https://www.linkedin.com/pulse/drupal-8-search-api-processors-exclude-content-field-value-chechel/

aaronlsilber commented 5 years ago

Since we're using a view to display search results, I've used the filter for the Brightcove entity's 'Enabled' field (status) to filter out inactive videos. This is a decent temporary fix, but it would be ideal to exclude them from the index entirely.

image

aaronlsilber commented 5 years ago

It doesn't seem like the filter I added is working. It works if I set it to equal false (showing inactive videos), but not if I set it to true (showing active videos).