Using Taxonomy Hide, you will notice that these terms are no longer indexed by the Apache SOLR Search Integration module.

Is this desirable behaviour? I'd like to hide terms on teaser and node pages, but not from search indexes.

Should this be a feature?

[x] Hide Terms from HTML Output on Teaser and Node Pages
[ ] Exclude Terms from Search Indexes

Comments

jpmckinney’s picture

adam_b’s picture

Category: feature » bug

Sorry, I think this is a bug so I'm changing the category.

The module description says that terms will not be listed during node view - it says nothing about preventing indexing in other contexts.

I can't be the only person who uses both this module and Apache Solr - can this be fixed?

soghad’s picture

I believe there is a simple solution to this.

Solr indexes everything returned by a call to node_view($node, FALSE, FALSE), so all this module would have to do is check the $teaser and $page variables, implemented as $arg, and $arg2, respectively in the _taxonomy_hide_nodeapi function.

If both $teaser and $page ($arg and $arg2) are false, the module should not unset the terms. Then, SOLR will pick them up, but they will still be hidden in teaser and page views.

This change should fix everything related to indexing:

function _taxonomy_hide_nodeapi(&$node, $op, $arg = 0, $arg2 = 0) {

  // ...


  // Add a check for $arg and $arg2 ($teaser and $page)
  if (!empty($node->taxonomy) && ($arg || $arg2)) {

  // ...

}
mtsanford’s picture

The change in #3 did the trick for me. I'm using 6.x-1.2 pache SOLR Search Integration module.

teezee’s picture

There's also the $node->build_mode information which contains:
NODE_BUILD_NORMAL (= 0) when node is built in either $page or $teaser mode
NODE_BUILD_SEARCH_INDEX (= 2) when node is built for use in a search index

This information is also implemented by Apache Solr (checked with 6.x-1.2) in apachesolr.index.inc (line 50).

David Lesieur’s picture

Status: Active » Closed (duplicate)

This problem is being addressed in #308133: Re-implement with hook_link_alter().