What I'd like to do is have three separate search blocks. Each one would search only certain content types. But, I don't want the user to see the content-type drop-down in the boxes. That is, let's say I have 10 content types A-J. I want one block to search just A-G, one to search just B-C, and one to search just H-I. None of them should return results of content type J. Additionally, I don't want the user to be able to choose on the first (A-G) block to search, eg, just type B.

I thought that the way to do this would be to not check ANY boxes in the content selector section of the block's configuration settings and to content exclusion section to essentially blacklist the types I *don't* want in that particular search. So, to continue my example above, for the A-G block I ticked the H, I, and J types under content exclusion. However, when I search with that block, I get results from all types.

Is this a bug? If not, is there a way to use custom_search_blocks to do what I want?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sjay12’s picture

Same here with v7.x-1.9. Using Acquia Search.

Feedback on how to resolve much appreciated.

hwasem’s picture

First off, thanks for this module. It is saving me from re-writing my custom module after upgrading to D7. Yay!

I'm also using v7.x-1.9 using the standard Drupal search and seeing this. I have a block in the header of each page that is just a simple search of my site and a Custom Search to an external site. I'm seeing this problem on my site search (not external site).

In the Custom Search "Content selector" tab, I left all content types searchable and set my Intranet Page content type as Content exclusion.

In the search results page's Advanced Search, the Intranet content type is still an option.

To test further I checked all content types EXCEPT Intranet Page and also set Intranet Page as content exclusion. Intranet still shows up in the Advanced Search content type options.

I also have the Custom Search config Results tab set to exclude Intranet. Intranet is still a content type option in Advanced Search.

Content in the Intranet type is not showing up in the results, but I'd like entire view/mention of Intranet to be excluded and not an option.

Did either of you solve this issue on your sites?

Anonymous’s picture

I am also having this problem. I've excluded 3 content types, but I am still seeing them show up in search results. I'm guessing no solution has been found for this yet?

jdanthinne’s picture

Version: 6.x-1.9 » 6.x-1.x-dev

Can you test with the latest DEV version?
If you still have troubles, please send me a link to your test site please, and an account with permissions to check the custom search settings, so I can check on a real case.

amsentner’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

Can you fix on the 7.x branch as well? Running latest dev and am still seeing this issue excluded node types being indexed and displayed to the end user.

jdanthinne’s picture

@asent, @Kirshen: are you using the core Search module, or another one?

Anonymous’s picture

Version: 7.x-1.x-dev » 7.x-1.1

@jdanthinne Other than this module, of course, I'm using the core Search module.

Using the 7.x-11 version. (It's a live site for a customer, so don't want to use dev versions.)

jdanthinne’s picture

I've just tested it once more (DEV version) and everything seems to be ok. Don't forget that each block has its own settings for content exclusion (via Block configuration / Content).
But you have to try the DEV version, on a copy of your live site. I can't make a stable version if the bug is still there… that would be useless!

jdanthinne’s picture

Status: Active » Needs review
tijana.st’s picture

Did this ever get resolved?

I am using 7.x-1.12 and have the same problem, both in Custom Search and when using Custom Search Blocks.

Would be very good to even have a confirmation that it is a bug. Thanks.

lesliewagner1165’s picture

Issue summary: View changes

I'm using 7.x-1.16 and having the same problem. Two different custom search blocks, each set to include only one content type, but both types showing up in both searches.

The settings for the custom search blocks are pretty self-explanatory, so I'm reasonably certain I've got them right. Seems to be a bug?

Thanks,
Leslie

jsimonis’s picture

I found that if I don't also do the settings on the "results page" tab, none of the settings I did regarding what should/shouldn't be shown work.

jdanthinne’s picture

Status: Needs review » Postponed (maintainer needs more info)

@tijana.st, @lesliewagner1165, @jsimonis: are you using a custom theme that could overrides Custom Search theming functions, or another customization module (ie. Display Suite Search)?

lesliewagner1165’s picture

I'm using Adaptive Themes Mix and Match. I'm also using Nodeaccess and Rules modules. One content type is only available to members with paid subscription. (That's set up w/ Ubercart and roles, but not using the recurring subscription feature.)

jdanthinne’s picture

@lesliewagner1165: if you switch the default Garland theme, does the content exclusion work or not?

lesliewagner1165’s picture

Switching back to Garland theme does not fix the issue. Just to be sure I've done the setup correctly:
I have two blocks. In the configuration, under content>content selector only one content type is checked. Under content exclusion, all except that content type are checked. The second block has a different content type selected and all others excluded. I didn't change any of the settings in the module configuration, only for the individual blocks.

jdanthinne’s picture

And if you apply the same settings to the default search block, does it work or not? Just trying to see if it's a module bug or a custom block bug...

lesliewagner1165’s picture

Looks like I get the same result with the default block.

byronveale’s picture

This is what I have found in my case:

- the OP's desired behavior is executed perfectly with core search (additional search block, no content selectors, all but three content types excluded, see attached)

- no go with Apache Solr search (Acquia Search specifically)

I'm running:

Drupal 7.31
Custom Search (custom_search) 7.x-1.16
Apache Solr framework (apachesolr) 7.x-1.7
Apache Solr search (apachesolr_search) 7.x-1.7
Acquia search (acquia_search) 7.x-2.14
Apache Solr Schema drupal-4.3-solr-3.x
Database system MySQL, MariaDB, or equivalent
Database system version 5.1.66
PHP 5.3.18
Web server Apache/2.2.25 (Unix) PHP/5.3.18

Has anyone used this successfully with Solr?

kellyimagined’s picture

This is still not working.

Tested the following:

  • With core search
  • With Solr search
  • With dev
  • With contrib

I am willing to test in order to get this resolved.

Anonymous’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Component: Miscellaneous » Code
Status: Postponed (maintainer needs more info) » Needs review
FileSize
2.45 KB

This patch should fix content type exclusion for the Apache Solr search module.