PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Ahmed Khan   PHP ElasticSearch Custom Search   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP ElasticSearch Custom Search
Create a custom search function for ElasticSearch
Author: By
Last change:
Date: 3 years ago
Size: 318 bytes
 

Contents

Class file image Download
<?php
require "vendor/autoload.php";
require
"customsearch.php";

$search = new CustomSearch();
$search->setIndex("knowledgebase");
$search->setType("storm");
$search->setSearchColumn("question");
$result = $search->search("I want to know the parentage of jon snow");
echo
'<pre>';
print_r($result);
echo
'</pre>';
?>