views:

247

answers:

3

im a beginner in using solr.

i know that you can either use ajax solr or solr-php-client to get the search results from solr.

but which should i use or are there occasions you have to choose one of them?

for example, which one is a better solution for autocompletion and which one is better for search content in threads?

would appreciate if someone could shed a light on this.

A: 

For auto-completion, AJAX is the only valid option. As for searching threads, either way would be acceptable.

Jan Hančič
ajax is **not** the only option for auto-completion. you *can* use a server-side script.
Mauricio Scheffer
well if you have to call the server then it is. if you can pre-fetch all the possible suggestions then you can do it without XHR, off course ...
Jan Hančič
If you don't put everything client side up front, then Ajax **is** the only way to get the data from said server side script (unless you want to throw in a Flash HTTP object and claim it isn't Ajax)!
David Dorward
@David: this is about solr-ajax, not about ajax only.
Mauricio Scheffer
A: 
  • Use PHP (or another server side language) for essential functionality.
  • Use client side JS for optional extras.
  • Build on stuff that works.
David Dorward
-1 for being too vague.
Mauricio Scheffer
A: 

If you use SolrJS you're exposing your Solr instance to the world, so you need to make sure you disable the update handler. With solr-ajax you can set up a proxy to avoid this.

See Security concerns for details, also: http://wiki.github.com/evolvingweb/ajax-solr/comparison-to-solrjs

Mauricio Scheffer