Search Engine with PHP & Elasticsearch
Why Stack Overflow recommends it
Stack Overflow users link it as the walkthrough they followed when setting up Elasticsearch with PHP, usually when they hit errors or want to adapt it to another framework.
Recommended by 0 people across 0 different months, 2015 to 2017.
What it is
A 2014 Codecourse tutorial that builds a simple search engine in PHP backed by Elasticsearch. It installs the Elasticsearch PHP client with Composer, indexes documents, and builds a search form that queries and displays results.
What people said
Cites Ashutosh Nigam · 2015-03 · Stack Overflow · on “location of include file of elasticsearch for php”
I have installed elasticsearch in Ubuntu using apt-get as explained in: [LINK] Then I am trying to use elasticsearch in my php code which requires me to include file vendor/autoload.php . In the example elasticsearch is installed using composer. The example I am trying to follow is in this link: [this video] I tried to located autoload.php in my elasticsearch installation folders but it does not exist there. So I am struck on how to proceed with elasticsearch in php if I have installed it using apt-get? Do I need to again install it using composer as explained in the video around 3 min?
Cites skr07 · 2015-09 · Stack Overflow · on “Elastic search configuration issue with client call php”
I am using elasticsearch API php to build search results. I have configured everything in my xampp server. All the libraries downloaded from composer.json. In my composer.json file contains below code { "require": { "elasticsearch/elasticsearch": "~2.0" } } Libraries are successfully downloaded. After that i initialize the elastic search with below code <?php require 'vendor/autoload.php'; $client = ClientBuilder::create()->build(); It shows fatal error like as follows Fatal error: Class 'ClientBuilder' not found in E:\Xampp\htdocs\codeporn\elasticsearch\app\init.php on line 4 So i change the config code as, require_once 'vendor/autoload.php'; $es = new Elasticsearch\Client([ 'hosts' => ['12
Cites Rakesh · 2016-10 · Stack Overflow · on “How to convert this given tutorial video(php core) into codeigniter(elasticsearch:9200)”
I am newbie for codeigniter and get a chance to learn alot from it. Now i just wanted to include the elasticsearch in Codeigniter and searched for tutorial vedios there is nothing i can find and last i followed this tutorial so that i can make some changes and include in codeigniter . but i struck . Anyhelp will be great. Thank you in advance. <?php require_once 'vendor/autoload.php'; $es= new Elasticsearch\Client([ 'hosts' => ['127.0.0.1:9200'] ]); I just wanted to get this code into codeigniter . it is init.php file inside the App folder when you follow the tutorial. It is like there is no much tutorials to include elasticsearch and codeigniter. I have followed following tutorials Ref : [V
Cites Abdul Hadi Siraj · 2016-12 · Stack Overflow · on “Elasticsearch PHP Client Error - 500 unable to handle this request”
I was doing what this tutorial said [this video] . Basically I have added Elasticsearch PHP client using Composer. My Elasticsearch is running on Docker on localhost:32773. This is my index.php code. What I want to do is search through my documents in Elasticsearch and display just like in this tutorial. <?php use Elasticsearch\ClientBuilder; require 'vendor/autoload.php'; $hosts = [ // Just Domain ' [LINK] ', ' [LINK] ' // SSL to IP + Port ]; $clientBuilder = ClientBuilder::create(); // Instantiate a new ClientBuilder $clientBuilder->setHosts($hosts); // Set the hosts $client = $clientBuilder->build(); if(isset($_GET['q'])) { $q=$_GET['q']; $query=$es->search([ 'result'=> [ 'query'=>[ 'bool' =>
Cites Typewar · 2017-05 · Stack Overflow · on “Elasticsearch Unable to print array in PHP”
I followed this Video [this video] as a guide to get elasticsearch up and running with PHP, but I am unable to print or view the results. I can print the raw data, but i'm unable to go any deeper. Operating system: Debian (jessie) PHP version: 5.6.30 Java version: 1.7.0 Elasticsearch version: 5.4.0 I use this code to request the data: // Creating the request. if(!defined('JSON_PRESERVE_ZERO_FRACTION')) { define('JSON_PRESERVE_ZERO_FRACTION', 1024); } require_once('vendor/autoload.php'); // autoload which makes it "easier" // to get values from elasticsearch $hosts = [ "192.168.1.120:9200" ]; $client = Elasticsearch\ClientBuilder::create() ->setHosts($hosts) ->build(); // Define the search $query