forked from opensearch-project/opensearch-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update and add documentation (opensearch-project#138)
* Update documentation - readme, admins, userguide and contributing Signed-off-by: Vacha Shah <[email protected]>
- Loading branch information
Showing
6 changed files
with
168 additions
and
245 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,8 @@ | ||
# OpenSearch Ruby Client Admins | ||
## Admins | ||
|
||
## Current Admins | ||
| Admin | GitHub ID | Affiliation | | ||
| -------------------------| --------------------------------------- | ----------- | | ||
| Charlotte Henkle | [CEHENKLE](https://github.com/cehenkle) | Amazon | | ||
| Henri Yandell | [hyandell](https://github.com/hyandell) | Amazon | | ||
|
||
| Admin | GitHub ID | Affiliation | | ||
| -------------------------| ----------------------------------------------------| ----------- | | ||
| Charlotte | [cehenkle](https://github.com/CEHENKLE) | Amazon | | ||
| Henri Yandell | [hyandell](https://github.com/hyandell) | Amazon | | ||
| Jayesh Hathila | [jayeshathila](https://github.com/jayeshathila) | Amazon | | ||
| Vamshi Vijay Nakkirtha | [vamshin](https://github.com/vamshin) | Amazon | | ||
| Yuvraj Jaiswal | [yuvi17](https://github.com/yuvi17) | Amazon | | ||
|
||
|
||
[This document](https://github.com/opensearch-project/.github/blob/main/ADMINS.md) | ||
explains what an admin's responsibilities are. | ||
[This document](https://github.com/opensearch-project/.github/blob/main/ADMINS.md) explains what admins do in this repo. and how they should be doing it. If you're interested in becoming a maintainer, see [MAINTAINERS](MAINTAINERS.md). If you're interested in contributing, see [CONTRIBUTING](CONTRIBUTING.md). |
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 |
---|---|---|
|
@@ -5,10 +5,6 @@ | |
- [Feature Requests](#feature-requests) | ||
- [Contributing Code](#contributing-code) | ||
- [Developer Certificate of Origin](#developer-certificate-of-origin) | ||
- [License Headers](#license-headers) | ||
- [Java](#java) | ||
- [Python, Ruby, Shell](#python-ruby-shell) | ||
- [Shell](#shell) | ||
- [Changelog](#changelog) | ||
- [Adding Changes](#adding-changes) | ||
- [Review Process](#review-process) | ||
|
@@ -19,7 +15,7 @@ OpenSearch is a community project that is built and maintained by people just li | |
|
||
## First Things First | ||
|
||
1. **When in doubt, open an issue** - For almost any type of contribution, the first step is opening an issue. Even if you think you already know what the solution is, writing down a description of the problem you're trying to solve will help everyone get context when they review your pull request. If it's truly a trivial change (e.g. spelling error), you can skip this step -- but as the subject says, when it doubt, [open an issue](issues). | ||
1. **When in doubt, open an issue** - For almost any type of contribution, the first step is opening an issue. Even if you think you already know what the solution is, writing down a description of the problem you're trying to solve will help everyone get context when they review your pull request. If it's truly a trivial change (e.g. spelling error), you can skip this step -- but as the subject says, when it doubt, [open an issue](https://github.com/opensearch-project/opensearch-ruby/issues/new/choose). | ||
|
||
2. **Only submit your own work** (or work you have sufficient rights to submit) - Please make sure that any code or documentation you submit is your work or you have the rights to submit. We respect the intellectual property rights of others, and as part of contributing, we'll ask you to sign your contribution with a "Developer Certificate of Origin" (DCO) that states you have the rights to submit this work and you understand we'll use your contribution. There's more information about this topic in the [DCO section](#developer-certificate-of-origin). | ||
|
||
|
@@ -31,47 +27,43 @@ Ugh! Bugs! | |
|
||
A bug is when software behaves in a way that you didn't expect and the developer didn't intend. To help us understand what's going on, we first want to make sure you're working from the latest version. | ||
|
||
Once you've confirmed that the bug still exists in the latest version, you'll want to check to make sure it's not something we already know about on the [open issues GitHub page](issues). | ||
Once you've confirmed that the bug still exists in the latest version, you'll want to check to make sure it's not something we already know about on the [open issues GitHub page](https://github.com/opensearch-project/opensearch-ruby/issues/new/choose). | ||
|
||
If you've upgraded to the latest version and you can't find it in our open issues list, then you'll need to tell us how to reproduce it Provide as much information as you can. You may think that the problem lies with your query, when actually it depends on how your data is indexed. The easier it is for us to recreate your problem, the faster it is likely to be fixed. | ||
|
||
### Feature Requests | ||
|
||
If you've thought of a way that OpenSearch could be better, we want to hear about it. We track feature requests using GitHub, so please feel free to open an issue which describes the feature you would like to see, why you need it, and how it should work. | ||
|
||
|
||
### Contributing Code | ||
|
||
As with other types of contributions, the first step is to [open an issue on GitHub](issues/new/choose). Opening an issue before you make changes makes sure that someone else isn't already working on that particular problem. It also lets us all work together to find the right approach before you spend a bunch of time on a PR. So again, when in doubt, open an issue. | ||
As with other types of contributions, the first step is to [open an issue on GitHub](https://github.com/opensearch-project/opensearch-ruby/issues/new/choose). Opening an issue before you make changes makes sure that someone else isn't already working on that particular problem. It also lets us all work together to find the right approach before you spend a bunch of time on a PR. So again, when in doubt, open an issue. | ||
|
||
## Developer Certificate of Origin | ||
|
||
OpenSearch is an open source product released under the Apache 2.0 license (see either [the Apache site](https://www.apache.org/licenses/LICENSE-2.0) or the [LICENSE file](LICENSE)). The Apache 2.0 license allows you to freely use, modify, distribute, and sell your own products that include Apache 2.0 licensed software. | ||
OpenSearch is an open source product released under the Apache 2.0 license (see either [the Apache site](https://www.apache.org/licenses/LICENSE-2.0) or the [LICENSE.txt file](LICENSE.txt)). The Apache 2.0 license allows you to freely use, modify, distribute, and sell your own products that include Apache 2.0 licensed software. | ||
|
||
We respect intellectual property rights of others and we want to make sure all incoming contributions are correctly attributed and licensed. A Developer Certificate of Origin (DCO) is a lightweight mechanism to do that. | ||
|
||
The DCO is a declaration attached to every contribution made by every developer. In the commit message of the contribution, the developer simply adds a `Signed-off-by` statement and thereby agrees to the DCO, which you can find below or at [DeveloperCertificate.org](http://developercertificate.org/). | ||
|
||
``` | ||
Developer's Certificate of Origin 1.1 | ||
By making a contribution to this project, I certify that: | ||
(a) The contribution was created in whole or in part by me and I | ||
have the right to submit it under the open source license | ||
indicated in the file; or | ||
(b) The contribution is based upon previous work that, to the | ||
best of my knowledge, is covered under an appropriate open | ||
source license and I have the right under that license to | ||
submit that work with modifications, whether created in whole | ||
or in part by me, under the same open source license (unless | ||
I am permitted to submit under a different license), as | ||
Indicated in the file; or | ||
(c) The contribution was provided directly to me by some other | ||
person who certified (a), (b) or (c) and I have not modified | ||
it. | ||
(d) I understand and agree that this project and the contribution | ||
are public and that a record of the contribution (including | ||
all personal information I submit with it, including my | ||
|
@@ -90,58 +82,25 @@ Signed-off-by: Jane Smith <[email protected]> | |
|
||
You may type this line on your own when writing your commit messages. However, if your user.name and user.email are set in your git configs, you can use `-s` or `– – signoff` to add the `Signed-off-by` line to the end of the commit message. | ||
|
||
## License Headers | ||
|
||
New files in your code contributions should contain the following license header. If you are modifying existing files with license headers, or including new files that already have license headers, do not remove or modify them without guidance. | ||
|
||
### Java | ||
|
||
``` | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
``` | ||
|
||
### Python, Ruby, Shell | ||
``` | ||
# Copyright OpenSearch Contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
``` | ||
|
||
|
||
### Shell | ||
``` | ||
# Copyright OpenSearch Contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
``` | ||
|
||
## Changelog | ||
|
||
OpenSearch-ruby maintains a version specific changelog for each gem adhering to the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format. | ||
OpenSearch-ruby maintains a version specific changelog by enforcing a change to the ongoing [CHANGELOG](CHANGELOG.md) file adhering to the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format. | ||
|
||
The changes are curated by version, with the changes to the main branch added chronologically to the `Unreleased` version. Each version has corresponding sections which list out the category of the change - `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`. | ||
|
||
|
||
### Adding Changes | ||
|
||
As a contributor, you must ensure that every pull request has its changes listed out within the corresponding gem, version, and appropriate section of the file. | ||
As a contributor, you must ensure that every pull request has its changes listed out within the corresponding version and appropriate section of the [CHANGELOG](CHANGELOG.md) file. | ||
|
||
Each change must reference the Pull Request or the Issue it addresses. | ||
Adding in the change is a two step process - | ||
1. Add your changes to the corresponding section within the CHANGELOG file with dummy pull request information, publish the PR. | ||
|
||
2. Update the entry for your change in [`CHANGELOG.md`](CHANGELOG.md) and make sure that you reference the pull request there. | ||
|
||
## Review Process | ||
|
||
We deeply appreciate everyone who takes the time to make a contribution. We will review all contributions as quickly as possible. As a reminder, [opening an issue](issues/new/choose) discussing your change before you make it is the best way to smooth the PR process. This will prevent a rejection because someone else is already working on the problem, or because the solution is incompatible with the architectural direction. | ||
We deeply appreciate everyone who takes the time to make a contribution. We will review all contributions as quickly as possible. As a reminder, [opening an issue](https://github.com/opensearch-project/opensearch-ruby/issues/new/choose) discussing your change before you make it is the best way to smooth the PR process. This will prevent a rejection because someone else is already working on the problem, or because the solution is incompatible with the architectural direction. | ||
|
||
During the PR process, expect that there will be some back-and-forth. Please try to respond to comments in a timely fashion, and if you don't wish to continue with the PR, let us know. If a PR takes too many iterations for its complexity or size, we may reject it. Additionally, if you stop responding we may close the PR as abandoned. In either case, if you feel this was done in error, please add a comment on the PR. | ||
|
||
|
File renamed without changes.
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 |
---|---|---|
|
@@ -7,8 +7,11 @@ | |
OpenSearch Ruby Client | ||
|
||
- [Welcome!](#welcome) | ||
- [Sample Code](#sample-code) | ||
- [Project Resources](#project-resources) | ||
- [Code of Conduct](#code-of-conduct) | ||
- [Compatibility with OpenSearch](#compatibility-with-opensearch) | ||
- [Security](#security) | ||
- [License](#license) | ||
- [Copyright](#copyright) | ||
|
||
|
@@ -17,131 +20,15 @@ OpenSearch Ruby Client | |
**opensearch-ruby** is [a community-driven, open source fork](https://aws.amazon.com/blogs/opensource/introducing-opensearch/) of elasticsearch-ruby licensed under the [Apache v2.0 License](LICENSE.txt). | ||
For more information, see [opensearch.org](https://opensearch.org/). | ||
|
||
## Setup | ||
## Sample Code | ||
|
||
To add the client to your project, install it using [RubyGem](https://rubygems.org/) | ||
|
||
`gem install opensearch-ruby` | ||
|
||
or, install it from a source code checkout: | ||
```bash | ||
git clone https://github.com/opensearch-project/opensearch-ruby.git | ||
cd opensearch-ruby/opensearch | ||
gem build opensearch.gemspec | ||
gem install opensearch-ruby-<version>.gem | ||
``` | ||
|
||
Import the client as a module: | ||
|
||
`require 'opensearch'` | ||
|
||
If you prefer to add the client manually or just want to examine the source code, see [opensearch-ruby on GitHub](https://github.com/opensearch-project/opensearch-ruby). | ||
|
||
## Sample code | ||
|
||
```ruby | ||
require 'opensearch' | ||
|
||
|
||
# If you want to use authentication credentials | ||
client = OpenSearch::Client.new( | ||
host: 'https://admin:admin@localhost:9200', # For testing only. Don't store credentials in code. | ||
transport_options: { ssl: { verify: false } } # For testing only. Use certificate for validation. | ||
) | ||
|
||
# If you don't want to use authentication credentials | ||
#client = OpenSearch::Client.new url: 'http://localhost:9200', log: true | ||
|
||
# Create an index with non-default settings. | ||
index_name = 'ruby-test-index' | ||
index_body = { | ||
'settings': { | ||
'index': { | ||
'number_of_shards': 4 | ||
} | ||
} | ||
} | ||
|
||
response = client.indices.create( | ||
index: index_name, | ||
body: index_body | ||
) | ||
|
||
puts 'Creating index:' | ||
puts response | ||
|
||
|
||
# Add a document to the index. | ||
document = { | ||
'title': 'Moneyball', | ||
'director': 'Bennett Miller', | ||
'year': '2011' | ||
} | ||
id = '1' | ||
|
||
response = client.index( | ||
index: index_name, | ||
body: document, | ||
id: id, | ||
refresh: true | ||
) | ||
|
||
puts 'Adding document:' | ||
puts response | ||
|
||
|
||
|
||
# Search for the document. | ||
q = 'miller' | ||
query = { | ||
'size': 5, | ||
'query': { | ||
'multi_match': { | ||
'query': q, | ||
'fields': ['title^2', 'director'] | ||
} | ||
} | ||
} | ||
|
||
response = client.search( | ||
body: query, | ||
index: index_name | ||
) | ||
puts 'Search results:' | ||
puts response | ||
|
||
|
||
# Delete the document. | ||
response = client.delete( | ||
index: index_name, | ||
id: id | ||
) | ||
|
||
puts 'Deleting document:' | ||
puts response | ||
|
||
# Delete the index. | ||
response = client.indices.delete( | ||
index: index_name | ||
) | ||
|
||
puts 'Deleting index:' | ||
puts response | ||
|
||
``` | ||
|
||
## AWS Managed Opensearch with Sigv4 | ||
|
||
If you have the need to sign every request with AWS Sigv4 to be able to communicate with an Opensearch cluster managed by AWS, use `opensearch-aws-sigv4` gem in place of `opensearch-ruby` gem. | ||
|
||
For more information, | ||
checkout the [README](opensearch-aws-sigv4/README.md) of [opensearch-aws-sigv4](opensearch-aws-sigv4) | ||
Please see the [USER_GUIDE](USER_GUIDE.md) for code snippets. | ||
|
||
## Project Resources | ||
|
||
* [Project Website](https://opensearch.org/) | ||
* [Downloads](https://opensearch.org/downloads.html). | ||
* [Documentation](https://opensearch.org/docs/) | ||
* [Documentation](https://opensearch.org/docs/latest/clients/ruby/) | ||
* [Ruby Gems](https://rubygems.org/gems/opensearch-ruby). | ||
* Need help? Try [Forums](https://discuss.opendistrocommunity.dev/c/clients/) | ||
* [Project Principles](https://opensearch.org/#principles) | ||
* [Contributing to OpenSearch](CONTRIBUTING.md) | ||
|
@@ -154,6 +41,14 @@ checkout the [README](opensearch-aws-sigv4/README.md) of [opensearch-aws-sigv4]( | |
|
||
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. | ||
|
||
## Compatibility with OpenSearch | ||
|
||
See [Compatibility](COMPATIBILITY.md). | ||
|
||
## Security | ||
|
||
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/) or directly via email to [email protected]. Please do **not** create a public GitHub issue. | ||
|
||
## License | ||
|
||
This project is licensed under the [Apache v2.0 License](LICENSE). | ||
|
Oops, something went wrong.