Need SOLR and PHP Help

I figured out how to add xml files to SOLR and be able to search them through the SOLR ADMIN interface ...

I need to know how to get SOLR to work with PHP and index MYSQL records ...

This is what I want to do: I have a mysql table that I would like to add to SOLR (index it) so that instead of searching for a MYSQL table directly through PHP I first take a querystring , send it to SOLR, and then SOLR sends the results to form ID:nrs , and then uses ID: s to query mysql and get the correct records ...

I have no clue on how to communicate with SOLR using PHP, any help is appreciated!

thanks

+4
source share
3 answers

Here is a good article to help you integrate PHP and SOLR:

http://www.ibm.com/developerworks/opensource/library/os-php-apachesolr/

There are a number of PHP interfaces in SOLR, this article mentions the PHP SOLR client:

http://code.google.com/p/solr-php-client/

but there also:

http://pecl.php.net/package/solr

+3
source

I would suggest starting with using DataImportHandler ( http://wiki.apache.org/solr/DataImportHandler ) to index the database and use one of the many Solr PHP clients (see the SolrPHP wiki page ). Note that Solr also emits JSON responses, so if you are familiar with JSON, this may be the easiest way to get started.

+1
source

I was there too, and this was the first time I found the Internet annoying! Maybe it's because I was in such a hurry to find out in a minute. Here is what I suggest:

  • 1. Do not panic. Understanding the work or even just implementing it takes more than a few seconds. So, keep some time aside for this.

  • 2. Learn how to use JSON. You can use this to communicate in different languages.

  • 3. Check the apache site

+1
source

All Articles