Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solr as main search engine, Redis as autocomplete engine

Tags:

redis

solr

I have an app with about 1+ million records.

  • I plan to use Solr to handle all searches.
  • I also have a feature for autocomplete.

I understand that Redis is very fast for autocomplete, but Solr also has its own autocomplete feature.

Question: Should I use Solr as main search engine (for non-autocomplete tasks) and a separate Redis for autocomplete, or I am better off using just Solr to complete both tasks?

Notes:

  • Load-balancing is a concern too.
  • Using Rails by the way.

Thanks.

like image 935
Victor Avatar asked Apr 23 '12 05:04

Victor


1 Answers

I think that you're just going to unnecessarily complicate things with Redis (I'm normally big fan of Redis).
Solr has its own autocomplete, as you mentioned already.
I wouldn't say 1 million docs is a big index for production environment. On the contrary, I'd say it's a rather small one.
So I wouldn't expect any problems with Solr's autocomplete.
Besides the one you suggested, here's a different approach for implementing it, written as a step-by-step tutorial.

You're right, Redis is great for large scale stuff, but since your whole index is going to grow, at some time you'll have to scale Solr anyway (not only for autocomplete).

like image 157
Marko Bonaci Avatar answered Nov 13 '22 21:11

Marko Bonaci