-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: dblock <[email protected]>
- Loading branch information
Showing
8 changed files
with
88 additions
and
59 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,39 +10,40 @@ | |
|
||
## Welcome! | ||
|
||
**opensearch-php** is [a community-driven, open source fork](https://aws.amazon.com/blogs/opensource/introducing-opensearch/) of elasticsearch-php licensed under the [Apache v2.0 License](https://github.com/opensearch-project/opensearch-php/blob/main/LICENSE). For more information, see [opensearch.org](https://opensearch.org/). | ||
**opensearch-php** is [a community-driven, open source fork](https://aws.amazon.com/blogs/opensource/introducing-opensearch/) of elasticsearch-php licensed under the [Apache v2.0 License](LICENSE). For more information, see [opensearch.org](https://opensearch.org/). | ||
|
||
## Project Resources | ||
|
||
* [Project Website](https://opensearch.org/) | ||
* [User Guide And Sample Code](https://github.com/opensearch-project/opensearch-php/blob/main/USER_GUIDE.md) | ||
* [Developer Guide](https://github.com/opensearch-project/opensearch-php/blob/main/DEVELOPER_GUIDE.md) | ||
* [User Guide](USER_GUIDE.md) | ||
* [Samples](samples) | ||
* [Developer Guide](DEVELOPER_GUIDE.md) | ||
* [Downloads](https://opensearch.org/downloads.html). | ||
* [Documentation](https://opensearch.org/docs/latest/) | ||
* Need help? Try [Forums](https://discuss.opendistrocommunity.dev/) | ||
* [Project Principles](https://opensearch.org/#principles) | ||
* [Contributing to OpenSearch](https://github.com/opensearch-project/opensearch-php/blob/main/CONTRIBUTING.md) | ||
* [Maintainer Responsibilities](https://github.com/opensearch-project/opensearch-php/blob/main/MAINTAINERS.md) | ||
* [Release Management](https://github.com/opensearch-project/opensearch-php/blob/main/RELEASING.md) | ||
* [Admin Responsibilities](https://github.com/opensearch-project/opensearch-php/blob/main/ADMINS.md) | ||
* [Security](https://github.com/opensearch-project/opensearch-php/blob/main/SECURITY.md) | ||
* [Contributing to OpenSearch](CONTRIBUTING.md) | ||
* [Maintainer Responsibilities](MAINTAINERS.md) | ||
* [Release Management](RELEASING.md) | ||
* [Admin Responsibilities](ADMINS.md) | ||
* [Security](SECURITY.md) | ||
|
||
## Code of Conduct | ||
|
||
This project has adopted the [Amazon Open Source Code of Conduct](https://github.com/opensearch-project/opensearch-php/blob/main/CODE_OF_CONDUCT.md). For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq), or contact [[email protected]](mailto:[email protected]) with any additional questions or comments. | ||
This project has adopted the [Amazon Open Source Code of Conduct](CODE_OF_CONDUCT.md). For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq), or contact [[email protected]](mailto:[email protected]) with any additional questions or comments. | ||
|
||
## Sample code | ||
|
||
See [Sample Code](https://github.com/opensearch-project/opensearch-php/blob/main/USER_GUIDE.md). | ||
See [Sample Code](USER_GUIDE.md). | ||
|
||
## Compatibility with OpenSearch | ||
|
||
See [Compatibility](COMPATIBILITY.md). | ||
|
||
## License | ||
|
||
This project is licensed under the [Apache v2.0 License](https://github.com/opensearch-project/opensearch-php/blob/main/LICENSE). | ||
This project is licensed under the [Apache v2.0 License](LICENSE). | ||
|
||
## Copyright | ||
|
||
Copyright OpenSearch Contributors. See [NOTICE](https://github.com/opensearch-project/opensearch-php/blob/main/NOTICE) for details. | ||
Copyright OpenSearch Contributors. See [NOTICE](NOTICE) for details. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
### OpenSearch PHP Client Samples | ||
|
||
Start an OpenSearch instance. | ||
|
||
``` | ||
docker run -d -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" -e "OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123!" opensearchproject/opensearch:latest | ||
``` | ||
|
||
Run sample. | ||
|
||
``` | ||
export OPENSEARCH_PASSWORD=myStrongPassword123! | ||
composer install | ||
composer run index | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "opensearch-php/samples", | ||
"description": "OpenSearch PHP client samples.", | ||
"type": "project", | ||
"authors": [], | ||
"scripts": { | ||
"index": ["php index.php"] | ||
}, | ||
"repositories": [ | ||
{ | ||
"type": "path", | ||
"url": "../" | ||
} | ||
], | ||
"require": { | ||
"opensearch-project/opensearch-php": "dev-main" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
require_once __DIR__ . '/vendor/autoload.php'; | ||
|
||
$client = OpenSearch\ClientBuilder::fromConfig([ | ||
'Hosts' => [ | ||
'https://localhost:9200' | ||
], | ||
'BasicAuthentication' => ['admin', getenv('OPENSEARCH_PASSWORD')], | ||
'Retries' => 2, | ||
'SSLVerification' => false | ||
]); | ||
|
||
$info = $client->info(); | ||
|
||
echo "{$info['version']['distribution']}: {$info['version']['number']}\n"; | ||
|
||
?> |
This file contains 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
This file contains 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