Last active
January 6, 2024 11:06
-
-
Save atakde/f2f37180cc3c86c29fc900d71ae22a83 to your computer and use it in GitHub Desktop.
Bool Query Should 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 | |
$searchResults = $searchEngine->search( | |
[ | |
'index' => 'search-linkedin-post', // index name | |
'_source' => 'public_linkedin_posts_new_text, public_linkedin_posts_new_poster_linkedin_url', // fields to return | |
'body' => [ | |
'query' => [ | |
'bool' => [ | |
'should' => [ | |
[ 'match' => [ 'public_linkedin_posts_new_text' => 'react' ] ], | |
[ 'match' => [ 'public_linkedin_posts_new_poster_linkedin_url' => 'atakan' ] ], | |
] | |
] | |
] | |
] | |
] | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment