1

I have a Solr server setup, working great, and sitting behind an Apache proxy server which limits access to a range of IP's.

To date our application(built in ZF/PHP) would use a PHP proxy function to query the Solr instance.(the ZF server's IP is allowed) however, I've been testing a new interface and have noticed querying Solr directly from JS is light-years faster than using PHP code to proxy things.

The page I'm testing runs 25+ solr queries per page load. Using pure JS this loads great, using PHP -not even close to usable.

Is there a way to proxy the client-side using jQuery or something much faster than PHP?

I've been searching for days, reading on various types of proxies, reverse proxies, securely querying webservices without exposing keys, etc.. But I'm still a bit lost as to the best way to query services using JS.

Any tutorials or advice would be much appreciated, cheers!

Mrmartin
  • 105
  • 1
  • 6
  • I'm just curious as to why the speed of queries would vary so much in PHP. After all the "direct" query in Solr must be technically very similar to a REST request made from PHP. Are you sure these problems are not network-related? – wroniasty Sep 27 '12 at 20:41
  • What is to stop a user from sending a `{'delete':'*:*'}` to your index, if its exposed? Please tune your LAMP for performance instead. – Jesvin Jose Sep 28 '12 at 06:19
  • A good point wroniasty ... after more googling it appears the php locked session is causing my calls to backup and execute super-slow similar to http://stackoverflow.com/questions/3760926/zend-auth-locked-session thanks for posting! – Mrmartin Sep 29 '12 at 14:35

1 Answers1

1

Why don´t you create a requestHandler which is designated to be directly called from the internet and make it accessible? (compare solrconfig.xml).

The Apache-Proxy could be configured to limit access to just this requestHandler (the URL of the requestHandler) and the requestHandler itself can be configured to add an implicit query (should be possible with an invariant fq-parameter).

If your update-requestHandler is not accessible it should be okay?!

cljk
  • 936
  • 1
  • 7
  • 20