# RFC on developer interface of new PHP client

**URL:** <https://discuss.elastic.co/t/rfc-on-developer-interface-of-new-php-client/10722>\
**Category:** Elasticsearch\
**Created:** [February 13, 2013, 12:30am UTC](https://discuss.elastic.co/t/rfc-on-developer-interface-of-new-php-client/10722 "2013-02-13T00:30:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [February 13, 2013, 12:30am UTC](https://discuss.elastic.co/t/rfc-on-developer-interface-of-new-php-client/10722/1 "2013-02-13T00:30:56Z")

</div>

I've been working on a PHP client for ElasticSearch and would like to get  
some comments/opinions on the library interface. The client is not in a  
workable state yet, but the developer API is starting to come together. I  
figure this is a good time to get some feedback before it becomes too  
entrenched. If you are a PHP developer, I'd love your thoughts! Please  
check the "Usage" section of the readme:

[https://github.com/polyfractal/elasticsearch-sherlock/tree/release/v0.1.0](https://github.com/polyfractal/elasticsearch-sherlock/tree/release/v0.1.0)

My main goal is to provide a library interface that focuses on simplicity  
and brevity. I dislike needing to know the internal classes of a library  
(e.g. to instantiate a QueryString class or whatever). Instead, Sherlock  
relies on the main library class to build requests through method calls. I  
also use method chaining liberally so that the developer can flow through  
various ES settings quickly.

That's the goal at least. But I've been staring at the code for a while,  
so outside opinion is greatly appreciated.

Cheers,  
-Zach

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [February 19, 2013, 9:04pm UTC](https://discuss.elastic.co/t/rfc-on-developer-interface-of-new-php-client/10722/2 "2013-02-19T21:04:27Z")

</div>

Quick update: I've added the ability to compose most library functions out  
of associative arrays or raw JSON instead of using the ORM interface  
(thanks for the suggestion Clinton / Joe), as well as refactoring various  
helper methods into static function. Finally, I've put up a basic  
quickstart guide to show a more extended example of the syntax:

[http://sherlockphp.org/quickstart.html](http://sherlockphp.org/quickstart.html)

I want to add filters and a bit more test coverage before releasing a  
version, but I'm hoping to have v0.1 out the door (and onto Packagist) by  
the end of the week.

Any comments, critique or hate mail welcome!  
-Zach

On Tuesday, February 12, 2013 7:30:56 PM UTC-5, Zachary Tong wrote:

> I've been working on a PHP client for Elasticsearch and would like to get  
> some comments/opinions on the library interface. The client is not in a  
> workable state yet, but the developer API is starting to come together. I  
> figure this is a good time to get some feedback before it becomes too  
> entrenched. If you are a PHP developer, I'd love your thoughts! Please  
> check the "Usage" section of the readme:
> 
> [https://github.com/polyfractal/elasticsearch-sherlock/tree/release/v0.1.0](https://github.com/polyfractal/elasticsearch-sherlock/tree/release/v0.1.0)
> 
> My main goal is to provide a library interface that focuses on simplicity  
> and brevity. I dislike needing to know the internal classes of a library  
> (e.g. to instantiate a QueryString class or whatever). Instead, Sherlock  
> relies on the main library class to build requests through method calls. I  
> also use method chaining liberally so that the developer can flow through  
> various ES settings quickly.
> 
> That's the goal at least. But I've been staring at the code for a while,  
> so outside opinion is greatly appreciated.
> 
> Cheers,  
> -Zach

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:50am UTC](https://discuss.elastic.co/t/rfc-on-developer-interface-of-new-php-client/10722/3 "2017-07-06T02:50:40Z")

</div>

Closed on July 6, 2017, 2:50am UTC


