agnostic_backend 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +19 -16
- data/doc/indexable.md +1 -1
- data/doc/queryable.md +3 -0
- data/lib/agnostic_backend/queryable/cloudsearch/result_set.rb +2 -2
- data/lib/agnostic_backend/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73a513561f2917abee7727c67df6cedba5e726fe
|
4
|
+
data.tar.gz: c55115526a99f35b449a71bf0c2cbdb217b5a110
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e0a967399f727fd7ed2146294cb6de0358039b136b2699f3ddec53e63211b12f52a36c7b6bf3bd15ed5e86925bf53f43cb87866619d132832811034181363ed
|
7
|
+
data.tar.gz: 2c08d23d1d45ca9c918e237c957907a53a3bae64fa8b1cfad93122e9f148e52c160314a1e017606d7da3dadac8d8e3097cdf220b2c3a23dfc994edebd80b53d9
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -2,22 +2,25 @@
|
|
2
2
|
Version](https://badge.fury.io/rb/agnostic_backend.svg)](https://badge.fury.io/rb/agnostic_backend)
|
3
3
|
[![Travis Build Status](https://travis-ci.org/e-travel/agnostic_backend.svg?branch=master)](https://travis-ci.org/e-travel/agnostic_backend)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/e-travel/agnostic_backend/badges/gpa.svg)](https://codeclimate.com/github/e-travel/agnostic_backend)
|
5
|
+
[![Dependency Status](https://gemnasium.com/e-travel/agnostic_backend.svg)](https://gemnasium.com/e-travel/agnostic_backend)
|
5
6
|
|
6
7
|
# Agnostic Backend
|
7
8
|
|
8
|
-
`agnostic_backend` is a gem that
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
`agnostic_backend` is a gem that adds indexing and searching
|
10
|
+
capabilities to Ruby objects for various backends.
|
11
|
+
|
12
|
+
It includes two modules: `Indexable` and `Queryable`.
|
13
|
+
`Indexable` provides indexing functionality by
|
14
|
+
specifying a way to define which object attributes should be
|
15
|
+
transformed in order to be eventually indexed to a remote backend
|
13
16
|
store. `Queryable` provides search and retrieval functionality by
|
14
17
|
specifying a generic query language that seamlessly maps to specific
|
15
18
|
backend languages.
|
16
19
|
|
17
20
|
In addition to these two modules, `agnostic_backend` supplies
|
18
|
-
additional classes (`Indexer` and `Index`) to support
|
19
|
-
configuration and functionality
|
20
|
-
elasticsearch, AWS Cloudsearch etc
|
21
|
+
additional classes (`Indexer` and `Index`) to support
|
22
|
+
configuration and transformation functionality for remote backends (such as
|
23
|
+
elasticsearch, AWS Cloudsearch etc).
|
21
24
|
|
22
25
|
Although the motivation and use case for the gem relates to
|
23
26
|
`ActiveRecord` models, no assumption is made as to the classes to
|
@@ -25,6 +28,10 @@ which `Indexable` and `Queryable` can be included. The objective is to
|
|
25
28
|
maximize the flexibility of clients with respect to the use cases they
|
26
29
|
need to address.
|
27
30
|
|
31
|
+
## Supported backends
|
32
|
+
|
33
|
+
* [AWS Cloudsearch](https://aws.amazon.com/cloudsearch/)
|
34
|
+
|
28
35
|
## Installation
|
29
36
|
|
30
37
|
Add this line to your application's Gemfile:
|
@@ -51,19 +58,15 @@ for more info on dependencies.
|
|
51
58
|
|
52
59
|
For the purposes of this document, we will focus on `ActiveRecord`
|
53
60
|
examples. Let's assume we have two AR models, `Task` and `Workflow`,
|
54
|
-
connected using an one-to-many relationship (i.e. a
|
55
|
-
many
|
61
|
+
connected using an one-to-many relationship (i.e. a Workflow has
|
62
|
+
many Tasks) as follows:
|
56
63
|
|
57
64
|
```ruby
|
58
65
|
class Task < ActiveRecord::Base
|
59
|
-
include AgnosticBackend::Indexable
|
60
|
-
|
61
66
|
belongs_to :workflow, class_name: 'Workflow'
|
62
67
|
end
|
63
68
|
|
64
69
|
class Workflow < ActiveRecord::Base
|
65
|
-
include AgnosticBackend::Indexable
|
66
|
-
|
67
70
|
has_many :tasks, class_name: 'Task'
|
68
71
|
end
|
69
72
|
```
|
@@ -217,7 +220,7 @@ AgnosticBackend::Indexable::Config.configure_index(
|
|
217
220
|
```
|
218
221
|
|
219
222
|
More information about the use of `Indexable` can be found in
|
220
|
-
[this document](
|
223
|
+
[this document](doc/indexable.md).
|
221
224
|
|
222
225
|
### Queryable
|
223
226
|
|
@@ -253,7 +256,7 @@ results = query.execute
|
|
253
256
|
```
|
254
257
|
|
255
258
|
For more information about `Queryable` check out
|
256
|
-
[this document](
|
259
|
+
[this document](doc/queryable.md).
|
257
260
|
|
258
261
|
|
259
262
|
### Backends
|
data/doc/indexable.md
CHANGED
@@ -289,4 +289,4 @@ end
|
|
289
289
|
|
290
290
|
This gives access to the matchers `be_indexable` and
|
291
291
|
`define_index_field`. For usage examples, check the
|
292
|
-
[corresponding test file](matchers_spec.rb).
|
292
|
+
[corresponding test file](https://github.com/e-travel/agnostic_backend/blob/master/spec/matchers_spec.rb).
|
data/doc/queryable.md
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: agnostic_backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iasonas Gavriilidis
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-03-
|
13
|
+
date: 2016-03-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|