Szymon Dudziak
Szymon Dudziak

Reputation: 542

Drupal with Near Realtime Search Solr

I have to implement Near Realtime search for Solr, strictly connected with Drupal. After add/edit each node, trigger should run Solr to index new content ( via soft commit) , without rebuilding whole index. Hard commit. Hard commit/reindex will be run from cron and that part is easy. But how to make index of each new/edited node in NRS ?

I'm using: CentOS 6.4 (httpd + mysqld), Solr 4.3.1 Drupal 7 with apachesolr module,

I'll be grateful for any suggestions.

Regards

Upvotes: 3

Views: 253

Answers (2)

Oliver Coleman
Oliver Coleman

Reputation: 794

Here's a solution that immediately indexes nodes on insert/update and only requires putting a little snippet of code into a custom module: https://www.drupal.org/node/1816462#comment-9093573

(Scroll up a bit to see implementation of hook_entity_insert/update().)

Upvotes: 1

Matt Ringer
Matt Ringer

Reputation: 1376

I have implemented NRS on various applications using the DIH by requesting delta-import command. Basically how it works is it keeps a timestamp record of when the last import was performed, and in your delta query you filter based on that timestamp. I have a job that tickles the delta command once every 5 minutes, but you could set the interval for what ever your requirement is.

Examples here.

DataImportHandler Wiki

Look for Delta-Import command.

Upvotes: 1

Related Questions