es-elasticity 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +31 -0
- data/LICENSE.txt +10 -19
- data/README.md +5 -0
- data/lib/elasticity.rb +14 -0
- data/lib/elasticity/index_mapper.rb +1 -2
- data/lib/elasticity/multi_search.rb +1 -1
- data/lib/elasticity/version.rb +1 -1
- data/spec/units/multi_search_spec.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d72499e7492430676f282eea3890061607c2b875
|
4
|
+
data.tar.gz: 7c912b62cb5c42c178454051ffab439315a4c7b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72078a3e8bbbb87bd6a34b31995df58da3380f87610870e77b415bbfa4330389d7ba918e6905a494007d11aef11254000931239a0a5844a40ab98c57a70b77c5
|
7
|
+
data.tar.gz: 644b482f73d666e6e9ac22f38bbf36e16507b9b894e75191cebebaf734e5dd6549d5d7baa8b0ca374d9c55093dcc0ed1ad2bcab0f40d09244addc650691c585c
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
We welcome contributions to this repository. Feel free to submit issues for bugs you encounter and pull requests for code and documentation contributions.
|
4
|
+
|
5
|
+
In order to prevent licensing issues, we require all contributors to sign an individual contributor license agreement, which is reproduced below:
|
6
|
+
|
7
|
+
## Individual Contributor License Agreement
|
8
|
+
|
9
|
+
In order to clarify the intellectual property license granted with Contributions from any person or entity, Doximity, Inc. ("Doximity") must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of Doximity; it does not change your rights to use your own Contributions for any other purpose.
|
10
|
+
|
11
|
+
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Doximity. Except for the license granted herein to Doximity and recipients of software distributed by Doximity, You reserve all right, title, and interest in and to Your Contributions.
|
12
|
+
|
13
|
+
### Definitions
|
14
|
+
|
15
|
+
"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Doximity. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
16
|
+
|
17
|
+
1. "Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to Doximity for inclusion in, or documentation of, any of the products owned or managed by Doximity (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to Doximity or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Doximity for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."
|
18
|
+
|
19
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to Doximity and to recipients of software distributed by Doximity a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.
|
20
|
+
|
21
|
+
3. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to Doximity and to recipients of software distributed by Doximity a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed.
|
22
|
+
|
23
|
+
4. You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to Doximity, or that your employer has executed a separate Corporate CLA with Doximity.
|
24
|
+
|
25
|
+
5. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions.
|
26
|
+
|
27
|
+
6. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
|
28
|
+
|
29
|
+
7. Should You wish to submit work that is not Your original creation, You may submit it to Doximity separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [[]named here]".
|
30
|
+
|
31
|
+
8. You agree to notify Doximity of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect.
|
data/LICENSE.txt
CHANGED
@@ -1,22 +1,13 @@
|
|
1
|
-
Copyright
|
1
|
+
Copyright 2015 Doximity, Inc.
|
2
2
|
|
3
|
-
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
4
6
|
|
5
|
-
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
12
8
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
data/README.md
CHANGED
@@ -398,3 +398,8 @@ Search::User.adults.active_record(User.where(active: true))
|
|
398
398
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
399
399
|
4. Push to the branch (`git push origin my-new-feature`)
|
400
400
|
5. Create a new Pull Request
|
401
|
+
6. Sign the CLA if you haven't yet. See CONTRIBUTING.md
|
402
|
+
|
403
|
+
## License
|
404
|
+
|
405
|
+
MPN is licensed under an Apache 2 license. Contributors are required to sign an contributor license agreement. See LICENSE.txt and CONTRIBUTING.md for more information.
|
data/lib/elasticity.rb
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2015 Doximity, Inc.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
require "rubygems"
|
2
16
|
require "bundler/setup"
|
3
17
|
Bundler.setup
|
@@ -18,6 +18,7 @@ module Elasticity
|
|
18
18
|
:delete_by_search,
|
19
19
|
:bulk_index,
|
20
20
|
:bulk_delete,
|
21
|
+
:map_hit,
|
21
22
|
to: to
|
22
23
|
)
|
23
24
|
end
|
@@ -118,8 +119,6 @@ module Elasticity
|
|
118
119
|
end
|
119
120
|
end
|
120
121
|
|
121
|
-
private
|
122
|
-
|
123
122
|
# Creates a instance of a document from a ElasticSearch hit data.
|
124
123
|
def map_hit(hit)
|
125
124
|
attrs = { _id: hit["_id"] }
|
@@ -46,7 +46,7 @@ module Elasticity
|
|
46
46
|
|
47
47
|
results[name] = case
|
48
48
|
when search[:documents]
|
49
|
-
resp["hits"]["hits"].map { |hit| search[:documents].
|
49
|
+
resp["hits"]["hits"].map { |hit| search[:documents].map_hit(hit) }
|
50
50
|
when search[:active_records]
|
51
51
|
Search::ActiveRecordProxy.from_hits(search[:active_records], resp["hits"]["hits"])
|
52
52
|
end
|
data/lib/elasticity/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: es-elasticity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Kochenburger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -176,6 +176,7 @@ files:
|
|
176
176
|
- ".rspec"
|
177
177
|
- ".simplecov"
|
178
178
|
- ".travis.yml"
|
179
|
+
- CONTRIBUTING.md
|
179
180
|
- Gemfile
|
180
181
|
- LICENSE.txt
|
181
182
|
- README.md
|