I have some content types that I don't want to appear in GSA search results, but I don't see any option for limiting them. Any way to do this? Thanks in advance.
I have some content types that I don't want to appear in GSA search results, but I don't see any option for limiting them. Any way to do this? Thanks in advance.
Comments
Comment #1
jweowu commentedThe content type is added to pages as a meta tag, and therefore indexed by the GSA/Mini. This module does facilitate meta tag filtering (and indeed any arbitrary QueryParts), but you have to write some code to make it happen. Usage will depend upon how you generated your meta tags, but in short you want to build an
$optionsarray to pass togoogle_appliance_search()in order to generate the QueryParts you need.The 'partialfields' and 'requiredfields' QueryParts enable you to match on meta tags. I recommend reading the GSA documentation regarding these options, as there are some pitfalls (e.g. limitations with AND/OR combinations, and the maximum limits on number of meta tags, and the amount of text per tag, that can be indexed).
See below for some example code (used with an older version of the module, but still relevant I think). That was a submission handler for a form which provided taxonomy terms in a select list. The terms appear in the pages as meta tags, and I convert the values into an
$options['requiredfields']entry when searching.See
theme_google_appliance_add_meta_tags()(which you can override in the usual fashion, of course) for meta tag generation. In one case I ended up writing an override so that I could put many values into a single meta tag (with 'partialfields' consequently used to match the values), as I ran into the indexing limits. I used a double-hyphen marker to delimit term boundaries, as the GSA treats hyphens as word characters (but practically nothing else other than the alpha-numeric chars).Your other option is to configure your GSA/Mini front end to filter out hits on the meta tags in question. That's simpler to configure, but then you run into the problem of the appliance lying about the number of results it found. This problem crops up when any kind of result filtering is performed by the appliance, and it causes the Drupal search results pager to be wrong, so I recommend not doing this.
Comment #2
jweowu commentedAnother option is to use the robots meta tag.
The GSA/Mini respects this, so you could add
<meta name="robots" content="noindex" />to your headers for the nodes which you do not want to be indexed.Of course, this will also prevent google.com (and other search engines) from indexing those pages, so it rather depends on whether or not that is acceptable. If it is, then this is makes for an easy solution to the problem.