Is this group active?

495 views
Skip to first unread message

Kapil.dalwani

unread,
Dec 8, 2009, 7:11:32 PM12/8/09
to PHP Solr Client
I am in middle of choosing the Solr + Php client and I found out two.
The original one at http://www.php.net/manual/en/book.solr.php and the
one here at code.google.com.

I am not sure which one to choose. Can someone list the advantages
this one offers from the one at php.net.

No offenses intended.

Thanks

Donovan Jimenez

unread,
Dec 8, 2009, 9:41:00 PM12/8/09
to php-sol...@googlegroups.com
Actually, Kapil, the PHP solr extension you linked to has only been released rather recently. It really has no affiliation with this project on google code. As to what you want to call the "original", that can be debated ad infinitum, there are several solr client libraries with different levels of features and complexity floating out there. The PHP solr extension is a compiled C module. This project is a PHP only solution.

Your decision will probably first be based on whether you can even install the PHP solr module on your target system. The next decision point would be which API you like better.  And then finally, whether you'll need to modify the source for either and how you'd do that (modify C and compile it, or modify PHP). Though I haven't done any benchmarks to prove it, I doubt there's much difference in speed (even though the module is compiled C), since most of your time is going to be spent on the Solr server in processing the request and in HTTP transfer.

- Donovan


--

You received this message because you are subscribed to the Google Groups "PHP Solr Client" group.
To post to this group, send email to php-sol...@googlegroups.com.
To unsubscribe from this group, send email to php-solr-clie...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/php-solr-client?hl=en.



Kapil Dalwani

unread,
Dec 8, 2009, 10:03:35 PM12/8/09
to php-solr-client
Hi Donovan,

Thanks for the reply. I am more interested in PHP Clients for Solr. As I said, I have two options a) PHP Solr Client or b) php.net one.   I am sorry, I careless metioned the latter as original. I though it was released earlier that this one.

I am looking for the API which is easy to use, has a lot of documentation and has good user support and also stable. I did read your API support the JSON format while the other is XML one. Any thoughts?

You are right speed is not much of a concern.

Best,
Kapil

Donovan Jimenez

unread,
Dec 8, 2009, 10:52:37 PM12/8/09
to php-sol...@googlegroups.com
We use the JSON output writer in Solr because it was considerably easier and faster to parse on the PHP side - pretty much a direct pass to the json_decode function. The response was usually smaller in size bytes wise. It's also one of the most stable and used other than the  XML output writer (for example there are PHP and serialized PHP output writers, but there were / are some issues with using them). 

There can be downsides to using a non-XML output writer. Some request handlers / plugins may not generate data structures that can be always be represented nicely in a hashmap / associate array manner (e.g if they repeat keys in a key / value list). This is why there's a list treatment parameter in the client that tells solr how to map key / value lists into JSON objects or arrays, but its not a perfect solution. All of the "standard" plugins for the most part generate a JSON object tree that makes sense to traverse.

I personally think our API is easy to use, but i'm a bit biased ;) . I have not yet used the solr module so I can't really speak to it. Both clients have generated documentation (mine is included in the download). I also have the wiki with some example code and this google discussion group - Israel Epko (the maintainer of the solr module) probably has something similar, I happen to know he's active on the solr user and developer mailing lists.

Our client is used by a drupal search plugin developed by the Acquia: http://acquia.com/products-services/acquia-search  . Its also used in my company's SAS applications: http://conduit-it.com  . I've also been pinged about Open Commerce plugins that are using it. I'm sure there are others I'll never know about.

I'd be interested in what decision you finally come to, especially if there was a problem in our client that made you turn away. Good luck with your project and I hope I've helped.

- Donovan

Kapil Dalwani

unread,
Dec 10, 2009, 2:55:41 AM12/10/09
to php-solr-client
Hey Donovan,

Thanks for your support. The good news is that I am using the client as provided by you. I tried to install the other one but it was very difficult to do so on an Ubuntu machine.
Also, yours is a simple php code in terms of wrapper. The other one needs to compile.

Thanks again.

Best,
Kapil




Sent from San Francisco, California, United States

Kapil Dalwani

unread,
Dec 16, 2009, 3:19:32 PM12/16/09
to php-solr-client
Hi group,

I have a question for you.

I have to run a query using the Apache_Solr_Service->search method.
My input format for the search query can be something like this.

$query =  array (
                         'id' => '1',
                         'name' => 'kapil dalwani',
                         'post' => 'lucene solr',
                          'location' => 'new delhi'
          )

My question to you is that the search method only takes the raw string as the input argument.
In case I want all the value in the $query to search upon, is there a method that does that or shall I implement of one my own? I am assuming it to be a OR rather than a AND query.

Thanks in advance.

Best,
Kapil

Donovan Jimenez

unread,
Dec 16, 2009, 4:48:22 PM12/16/09
to php-sol...@googlegroups.com
The client doesn't take anything but a string because there are many different ways that queries can be constructed. Trying to fit all use cases would have been too much.

For your case, the lucene syntax query would probably look like:

"id:1 name:(kapil dalwani) post:(lucene solr) location:(new delhi)"

To construct this you can use your own functions or you could use one of the lucene syntax query builders:

Zend Framework's Zend_Search_Lucene  classes can be used to construct a lucene query - you'll then get the raw query by casting the query object to a string, you can pass this to the solr search function.


Sequin is another option:


Hope the links help
- donovan

Kapil Dalwani

unread,
Dec 17, 2009, 2:45:52 AM12/17/09
to php-sol...@googlegroups.com
Thanks, 

The Zend is the one I am using. 

Best,
Kapil




Sent from Baltimore, MD, United States
Reply all
Reply to author
Forward
0 new messages