tags:

views:

46

answers:

1

Afternoon guys,

I'm using a SOLR index for searching through items on my site. The search results contain an average rating of the item and an amount of comments the item has. The results can be sorted by both rating and num of comments.

But obviously with the solr index, these numbers aren't updated until the db (2million~ rows) is reindexed (done nightly, probably).

What would you guys think is the best way to approach this?

+2  A: 

Well, i think you should change your db - index sync policy:

  • First approach: when commiting database changes also post changes (a batch of them) to indexes. You should write a mapper tier to map your domain objects to solr docs (remember, persists and if it goes ok then index -this works fine for us ;-)). If you want to achieve near real-time index updates you should see solutions like zoey (linkedin lucene-based searching framework)
  • Second approach: take a look around delta import (and program more frecuently index updates).
Lici
Excellent, thanks for the reply Lici, I'm going to take a good look at Zoie next week, is the interface, setup procedure similar to Solr? I'm not familiar with mapping domain object to solr docs, do you have any links that could enlighten? Again, massive thanks for your reply :)
thebluefox
Zoey is a lower-lever solution than Solr. I think the best solution is to continue indexing via DIH and also design you domain --> SolrInputDocument mapping tier to get fresh updated results. Your mapping tier depends on the client technology chosen. I use SolrJ (Java-based). See : http://wiki.apache.org/solr/IntegratingSolr
Lici