Drupal coder

search

Keeping track of backlinks in Drupal 6

A few posts back, I wrote about creating a list of articles that link to some other article, i.e. a list of "backlinks". That post back then was focused on Drupal 7.

I'm a bit shocked though, that nobody noticed or mentioned that this feature already exists in Drupal 6. I had no idea either. So this heads up here is to make things right.

When you have the core Search module enabled and have Views installed and enabled, you should get a default view called "backlinks".

drupal-6-backlinks.png

Sorry for my bad researching skills!

September 23, 2010Drupal, maintenance, search, SEO

Three things we learned from indexing a Drupal site with millions of nodes in Apache SOLR

For one of our clients, we are running a Drupal site with about a millions of nodes. Before launch, those nodes are imported from another database and then indexed into Apache SOLR. The total time to index all of these nodes in an empty SOLR instance is measured in days rather than hours or minutes.

A bit too long to do this import regularly. So me and my (XDebug) profiler delved into the Apache SOLR module code to look where we could scrape of a few hours/days of the execution time.

Seemed like in our case, there were 3 components responsible for a large share of the execution time. Let's have a look.

BTW. We are using the latest dev build of version 2 of the Apache SOLR module.

September 06, 2010Apache Solr, Drupal, performance, search

Keeping track of backlinks in Drupal 7

A popular feature request for sites that deal with a lot of content, is to see for each page what other pages are linking back to it. This can be helpful when doing some SEO or cleaning up and rewriting old content.

In Drupal 7 this is easily done. It exists where you wouldn't immediately expect it though: the core search module. Kind of mimicking how search bots like Google's indexer works, Drupal 7's search module now takes the amount of nodes linking back to another node to calculate the score for some result.

August 22, 2010Drupal 7, Drupal, maintenance, search, SEO

Performance tip : disable Drupal's core search indexer when using Apache Solr

Here's a quick tip for people using the (simply awesome) Apache Solr Search Integration module.

The Apache Solr module depends on Drupal's core Search module. This means the Search module will be enabled too when the Solr module is installed. As soon as the core Search module is enabled it starts to index all your nodes and stuff too. This not only takes time to run, but also fills up your database (search_dataset, search_index, ... tables).

Most of the time when you are installing the Apache Solr Search module, you don't need Drupal's core search form and replace the search form with the Apache Solr one using the Apache Solr module setting "Make Apache Solr Search the default:". You have now disabled the core Search module's form, but you have not disabled the indexing. To disable the indexing and save some CPU cycles and database space, just go to your site's search settings page (admin/settings/search) and set the "Number of items to index per cron run" to 0.

search-index-limit.png

A better alternative for improving search results when working with node references in Drupal

A few weeks ago I posted a tip on this blog for improving search results when working with node references in Drupal. While browsing the CCK interface a bit more I stumbled upon an easier (no programming!) solution to solve this problem. Seems I had looked over an option under "Display options" to configure how the field should be indexed.

April 17, 2010Drupal, search