Search API Exclude Entity

Last updated on
19 April 2017

The Search API Exclude Entity module is the Drupal 8 / Search API successor to Apache Solr Node Exclude. It makes it possible for editors and webmasters to exclude nodes and other entities from being indexed in search indexed configured using Search API framework.

Introduction

Compared to the Drupal 7 / Apache Solr version is the new Drupal 8 version using a custom field type, widget and formatter for controlling the exclude status on entities. This gives some advantages:

  • The field position, field label and description is configurable per entity / bundle.
  • It is possible to use multiple exclude fields on the same entity bundle, if multiple search systems or indexes is being used in the site.
  • Views integration out of the box without custom plugins.

The processing in Search API is handled using a custom configurable processing plugin.

Installation and configuration

1. Install required modules

Ensure that the following required modules is installed before proceeding to the configuration.

2. Adding fields to entity bundles

  1. Go to your entity bundle and choose manage fields.
  2. Click "Add field".
  3. Choose the field type "Search API Exclude Entity", add write a label and click save twice.
  4. Add a help text if needed and click save.

The field has now been added to the entity bundle. The field will automatically be placed in the right column with meta data on nodes and other entity types using this form layout.

The field is automatically added to the entity display. To remove it or change the formatter go to your entity bundle and choose "Manage Display".

Add field to entity bundle.

3. Adding processor to the search index.

Prerequisites: You have already configured a search server and an index.

  1. Go to your search index and choose "Processors".
  2. Enable "Search API Exclude Entity".
  3. Choose the field(s) that will be used to control the exclude status for this index.
  4. Click "Save".
  5. Don't forget to index/re-index! If you've got existing data in your index, you will need to clear the index first.

Enable "Search API Exclude Entity" processor and configure it.

Help improve this page

Page status: No known problems

You can: