Thanks to a passionate and friendly communication, PHP has kept up with the times. With its well-curated foundation, it’s one of the Internet's most used programming languages. You can find it in many popular applications around the world. And now we have two more place you can find it...
We are pleased to announce a double release of the first stable version of our search solution PHP clients:
A Sweet Composition
You can install either plugin using Compose.
We'll demonstrate with Site Search:
composer require elastic/site-search
Once you instantiate the client…
$apiKey = 'XXXXXXXXXXXX'; $clientBuilder = \Elastic\SiteSearch\Client\ClientBuilder::create($apiKey); $client = $clientBuilder->build();
Engines can be created and destroyed with ease. And you can optimize your Engine to perform at its best in over a dozen languages:
$engine = $client->createEngine('example-engine', 'en');
Documents can be structured and ingested with flexibility:
$documents = [ [ 'external_id' => 'first-document', 'fields' => [ ['name' => 'title', 'value' => 'First document title', 'type' => 'string'], ['name' => 'content', 'value' => 'Text for the first document.', 'type' => 'string'], ] ], [ 'external_id' => 'other-document', 'fields' => [ ['name' => 'title', 'value' => 'Other document title', 'type' => 'string'], ['name' => 'content', 'value' => 'Text for the other document.', 'type' => 'string'], ] ], ]; $indexingResults = $client->createOrUpdateDocuments('my-engine', 'my-document-type', $documents);
And of course, you can search with many useful parameters using robust and refined API endpoints:
$searchParams = ['per_page' => 10, 'page' => 2]; $searchResponse = $client->search('my-engine', 'fulltext search query', $searchParams);
What is Site Search?
Elastic Site Search is best known for its powerful web crawler, out of the box flexibility, and quick set-up that’s light on code. It's a managed service which provides all the tools you need to build engaging search experiences, and it's backed under the hood by the Elastic Stack.
How about App Search?
Elastic App Search is a refined suite of dynamic search APIs that you can use to write search into any facet of your application. Once constructed, a streamlined dashboard is there for any stakeholder to fine-tune the relevance model and improve search performance.
Features like Synonyms, Relevance Tuning, and Curations help your searchers find just what they need. Pair it with the open source Search UI and you have the hackable, powerful search engine and user experience you've always wanted
For more details on the App Search client, checkout the repository.
Signup for a free 14 day trial of either product to see which is best for you.