function search_block_apachesolr_node_exclude($node){
    return $node->search_block;
}

That should work, will update if it doesn't; see apache documentation on hooks for hook_apachesolr_node_exclude description.

I'm not bothering with a patch being that I assume this module has been abounded.

CommentFileSizeAuthor
#9 search_restrict_apache_solr.tar_.gz554 bytespromes

Comments

deviantintegral’s picture

Project: Restricted Search » Search Restrict
Version: 6.x-1.x-dev » 6.x-1.3

Neat!

I'm moving this over to the Search Restrict module as it would be a good feature over there, and I'm depreciating this module in favour of that one.

hefox’s picture

the node_exclude is used for when indexing, so would be a bad candiate for variable content type exclusion (also note apacheslr already excludes content types global setting). ; likely what you'd need for a by role restriction is the query_alter hook (it's in apache solr documentation); there's also some other hooks that may be useful but I didn't read too much into it.

robert castelo’s picture

Status: Active » Fixed

Fixed in 6.x-1.5, I'll port to D7 version shortly.

Added a new sub module that excludes content types from search, I used the query_alter hook so it works based on roles at the time of query rather than excluding from the index.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

promes’s picture

Version: 6.x-1.3 » 7.x-1.0
Status: Closed (fixed) » Needs work

In #3 it says: I'll port to D7 version shortly. But up till now there is no port. Is it just copying the search_restrict_apache_solr submodule fron D6 to D7?
Or is it allready present in D7?

promes’s picture

Status: Needs work » Fixed

I am sorry. It did the wrong tests.
It works in D7.

promes’s picture

Status: Fixed » Closed (fixed)

One request: please mention the Solr integration in the project page text of your module. It is a better place to find this functionality then having to search the issues and making mistakes while testing.

I am a fan of this module for many years now. Thanks for the good work.

robert castelo’s picture

Done.

promes’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new554 bytes

I must apologise for my post #6. It didn't work but my testsite still contained the old search data in MySQL and I did the test on that database without being aware of it. I am a newbee in Solr.
But I reorganised my testsite and I managed to create a search_restrict_apache_solr module like in D6 but now for D7. Attached is my version for D7.
For me it works.