Created
January 6, 2024 10:10
-
-
Save atakde/444dfaf23bc0876227d169a77b098771 to your computer and use it in GitHub Desktop.
Medium Elastic Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__); | |
$dotenv->load(); | |
use Atakan\ElasticEx\MySearchEngine; | |
$searchEngine = new MySearchEngine(); | |
$searchResults = $searchEngine->search( | |
[ | |
'index' => 'search-linkedin-post', // index name | |
'_source' => 'public_linkedin_posts_new_text', // fields to return | |
'body' => [ | |
'query' => [ | |
'match' => [ | |
'public_linkedin_posts_new_text' => 'Successful People' // search | |
] | |
] | |
] | |
] | |
); | |
$results = $searchResults->asArray(); | |
var_dump($results); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment