drupal 7 custom search exclude not working

1000 views Asked by At

I'm adjusting a drupal installation for a customer and added some custom content types. Now I want to exclude them from the search results.

So I looked into the manual on https://drupal.org/project/custom_search

Within Configuration > Search and metadata > Custom search [Tab: Content] I checked the types I want to exclude below Content exclusion

I saved the configuration and cleared all caches (just to be sure). But still all the content types show up in the results page /search/test (for example)

2

There are 2 answers

0
Remington On

The custom search settings located at *admin>config>search>custom_search* will only impact the main Drupal search block (which does not have it's own block settings). In order to change the content exclusion setting for a custom search block you will need to visit: admin>structure>block and then click the configure link next to your custom search block.

Once on the configure page scroll down to the "content" section, and check the boxes next to the content types you need to exclude.

After you save your block you should find that those content types no longer show up on the search results page.

Note: If you have multiple custom search blocks then you will need to configure the exclusion settings for each one.

1
user2269153 On

I ran into the same issue, and then found:

"Don't forget that each block has its own settings for content exclusion (via Block configuration / Content)."

(from: https://drupal.org/node/1516914#comment-7306658)