Logo

dev-resources.site

for different kinds of informations.

I wrote a PHP Client for sonic, the autosuggestion engine, and now its official PHP client. Ask Me Anything 🀩

Published at
4/11/2019
Categories
php
sonic
sockets
opensource
Author
ppshobi
Categories
4 categories in total
php
open
sonic
open
sockets
open
opensource
open
Author
7 person written this
ppshobi
open
I wrote a PHP Client for sonic, the autosuggestion engine, and now its official PHP client. Ask Me Anything 🀩

Hey guys, last week I got to see one article about a new search engine, similar to elastic search. but built specifically for autosuggestions. Sonic - it is an index based auto-suggestion engine built on Rust lang by the team at crip.chat . a customer engagement platform.

Then I went to their repository (Yep, its open source). And found out that it offers a TCP endpoint rather than an HTTP endpoint/. Meaning in order to use sonic search, you need to connect to the TCP socket and issue commands over the socket and read the output buffer. They are officially offering a javascript client for sonic but not for PHP. Then it struck me... This can be a good experience for me if I build a PHP client for it, especially because I haven't done any socket programming before.

Then I spent a few days and nights cooking the PHP client and submitted a PR into the official repo,

Added one more php client - psonic by ppshobi #118

Hi, I have gone ahead and implemented a PHP client for sonic, including unit tests and a relatively complete readme and an api documentation as well.

Saying that kindly include my client as well in the readme. Then I tweeted about the same in twitter as well.

Ahaa... There it was. The CTO of crisp and the core contributor of Sonic, Mr. Valerian Saliou replied to me saying that, he liked the way I wrote the code and he can promote my client as an officially supported sonic client for PHP if I come up with a relatively complete solution.

Well then..., few more nights and voila. Now Psonic is the official php client for sonic. Check it out, and give your valuable opinions in the comments as well as GitHub stars 😍.

GitHub logo ppshobi / psonic

Sonic is a super fast auto suggestion engine built by the team at crisp.chat, a customer engagement platform. its built in Rust and they officially support a javascript client, but if you want to use sonic via php, this is the library that you can look for. Completely unit tested, and adheres to modern coding standards, and offers a clean api to interact with sonic.

Psonic - PHP client for sonic auto suggestion engine

codecov

.github/workflows/tests.yml

Summary

Sonic is a super fast auto-suggestion engine built by the team at crisp.chat, a customer engagement platform. it is built in Rust and they officially support a javascript client, but if you want to use sonic via PHP, this is the library that you can look for Completely unit tested, and adheres to modern coding standards, and offers a clean API to interact with sonic.

Installation & Usage

you need a running sonic instance (locally or in the cloud, the port 1491 should be accessible) php7+ and composer to make this library work. Read more on installing sonic

  • goto your project directory
  • execute composer require ppshobi/psonic once the installation is completed you should be able to use the library as follows

Api Documentaion

Full API Documentaion

Usage

once you have psonic in place, you have access to the Client…

Go ahead and try sonic as well. It's a really cool product. 😍😍😍

sockets Article's
30 articles in total
Favicon
Master Linux File Types While Your Coffee Brews
Favicon
Why most HTTP servers are multithreaded and how to build one from scratch
Favicon
Talking to a Gmail POP3 server with Python
Favicon
You (probably) do not understand UDP
Favicon
Creating a nextjs chat app for learning to integrate sockets
Favicon
Tipos de Sockets em TCP e UDP: Escolhendo o Caminho Adequado
Favicon
Introdução aos Sockets em Python
Favicon
How to broadcast live data on your application?
Favicon
lets compare network sockets between Perl and Python
Favicon
Communicating with WebRTC or WebSocket
Favicon
A terminal real time application with Dart Sockets
Favicon
Building a Redis client from scratch in Go
Favicon
Socket sharding in Linux example withΒ Go
Favicon
Real-Time Interactive Plotting (using Sockets, Python & Plotly)
Favicon
What are sockets in computer networks?
Favicon
Fun with Sockets!
Favicon
Integrating Sockets in Kotlin
Favicon
Basics of Sockets
Favicon
Simple tweet locator using Python, Flask SocketIO and Tweepy
Favicon
Captive Web Portal for ESP8266 with MicroPython - Part 3
Favicon
Using BSD Sockets in Swift
Favicon
I wrote a PHP Client for sonic, the autosuggestion engine, and now its official PHP client. Ask Me Anything 🀩
Favicon
Mercure (Simple Real-Time Updates)
Favicon
The Gopher Protocol in Brief
Favicon
Socket Programming in C: Introduction
Favicon
Receiving data from ESP8266 sensors
Favicon
Socket Programming in C: Communication Styles
Favicon
Socket Programming in C: What is a Socket?
Favicon
sockjs_test_server_nwjs – SockJS test server on NW.js
Favicon
Simplest technique to develop multi-threaded apps with UI update

Featured ones: