-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.php
73 lines (66 loc) · 2.65 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
require "vendor/autoload.php";
use SyncMySql\SyncMySQL;
use SyncMySql\Connection\MySQLiConnection;
use SearchElastic\Search;
use ElasticSearchClient\Mapping;
// $con = new mysqli('localhost','root','','laravel');
// $mysqls = new MySQLiConnection();
$connection = new \PDO('mysql:host=localhost;dbname=laravel;','root', '');
$sync = new Search();
$sync->setIndex("blog");
$sync->setType("user");
$sync->setSearchColumn("name");
// $sync->setConnection($mysqls);
echo print_r($sync->search("ahmed khan"));
// echo print_r($sync->updateNode($con,'users',21));
// echo $sync->insertNode([
// "id" => 5,
// "name0" => "abc",
// "design" => "pattern"
// ]);
// $search = new Search();
// $search->setIndex("abc");
// $search->setType("asd");
// $search->setSearchColumn("name");
// echo print_r($search->search("ahmed"));
// $client = new Mapping();
// // $map=;
// $mapping = ['index' => 'abc3',
// 'body' => [
// 'mappings' => [
// 'article' => [
// 'properties' => [
// 'id' => [
// 'type' => 'integer'
// ],
// 'article_name' => [
// 'type' => 'string'
// ],
// 'article_content' => [
// 'type' => 'string'
// ],
// 'article_url' => [
// 'type' => 'string'
// ],
// 'category_name' => [
// 'type' => 'string'
// ],
// 'username' => [
// 'type' => 'string'
// ],
// 'date' => [
// 'type' => 'date',
// 'format' => 'dd-MM-yyyy'
// ],
// 'article_img' => [
// 'type' => 'string'
// ],
// ]
// ]
// ]
// ]
// ];
// echo print_r($client->deleteMapping("abc"));
$connection = new PDO('mysql:host=localhost;dbname=laravel;','root', '');
print_r($connection);