elasticsearch_query 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -0
- data/Gemfile +0 -3
- data/Gemfile.lock +1 -1
- data/README.md +5 -1
- data/lib/elasticsearch_query/filter_formatter/base.rb +0 -4
- data/lib/elasticsearch_query/query.rb +2 -2
- data/lib/elasticsearch_query/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 947e124ddb471f70dad5a0caf9f27a1058d6cbb3
|
4
|
+
data.tar.gz: de1f1e1c75f0a308cf38a6cb0d71cfc6c3b2e6a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f871f3925301d1c15e5b6af22c7df0735520165b90b531c30b7bcf9eeefd58f272d3a2077c79ae4b4dc08080dff6aabc4b53bf603518d7cef7eeaa0649a2a5f
|
7
|
+
data.tar.gz: 38b1243114480c9154afe2271f66197c86337f74db03af1a098d3ea601fa00ccc0f89bce05af3543a42dd4a10aded7e32236b546d80ff5f580cbe32596d30493
|
data/.travis.yml
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
sudo: false
|
2
|
+
env:
|
3
|
+
global:
|
4
|
+
- CC_TEST_REPORTER_ID=a444da626f5bb799687a24c22f8d7d5295cb28e88f5447b6ea18d07078324bce
|
2
5
|
language: ruby
|
3
6
|
rvm:
|
4
7
|
- 2.4.3
|
8
|
+
before_script:
|
9
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
10
|
+
- chmod +x ./cc-test-reporter
|
11
|
+
- ./cc-test-reporter before-build
|
5
12
|
before_install: gem install bundler -v 1.16.1
|
13
|
+
after_script:
|
14
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# ElasticsearchQuery
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/gaorlov/elasticsearch_query.svg?branch=master)](https://travis-ci.org/gaorlov/elasticsearch_query)
|
4
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/0d9870cdf0ef6e5a659f/test_coverage)](https://codeclimate.com/github/gaorlov/elasticsearch_query/test_coverage)
|
5
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/0d9870cdf0ef6e5a659f/maintainability)](https://codeclimate.com/github/gaorlov/elasticsearch_query/maintainability)
|
6
|
+
|
3
7
|
`ElasticsearchQuery` is a tranformer from [`JSONAPI`](http://jsonapi.org) style params hash into an [`Elasticseatch-ruby`](https://github.com/elastic/elasticsearch-ruby)-compatible object that can easily be fed into `client.search`
|
4
8
|
|
5
9
|
*Note*: This gem was written for use with a [modified](https://github.com/tiagopog/jsonapi-utils/pull/90) [`JSONAPI::Utils`](https://github.com/tiagopog/jsonapi-utils/) and uses several concepts from it (Paginator interface, param structure), but has no hard dependencies.
|
@@ -73,7 +77,7 @@ class MyPaginator
|
|
73
77
|
end
|
74
78
|
```
|
75
79
|
|
76
|
-
What the params look like and how you extract the page size and offset(`from`) are up to you.
|
80
|
+
What the params look like and how you extract the page size(`size`) and offset(`from`) are up to you.
|
77
81
|
|
78
82
|
#### RangeFormatter
|
79
83
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module ElasticsearchQuery
|
2
2
|
class Query
|
3
3
|
def initialize( params )
|
4
|
-
if params.respond_to? :
|
5
|
-
@params = params.
|
4
|
+
if params.respond_to? :with_indifferent_access
|
5
|
+
@params = params.with_indifferent_access
|
6
6
|
else
|
7
7
|
@params = params
|
8
8
|
end
|