s3search 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 93860ffead9f069dc475c369b5cf87942f1e22c6
4
- data.tar.gz: 020a5ed8bd7c10c4d8d6937d4a3d6b8523bdf742
3
+ metadata.gz: 46060eeb31d5f7496459508bc323467e7cc8f8fb
4
+ data.tar.gz: 728633e55da9327cca3d77f9f8bc05bca43b3c20
5
5
  SHA512:
6
- metadata.gz: 2b3c57cd0b7ad978ad99a93c05cab3bf1863edc52b30c75c0b70ae0f0b38770f892c1dcb8407464da709e375ba83e4b53ce64bd734bfc3e4482652cb0143bfd6
7
- data.tar.gz: c3c1ba2c23cb56c446bc790c67d4811291f196809d0e15d247bc303830f1a46cf372bdd38ede0ef2b05a547412823fe3229826196f2a81ab17ad54879b99cf2b
6
+ metadata.gz: f826c28b84ec3eea2de873ffa386b8fe7af41e862973dc2358bc33cc880cd738fa65b4cd65aec45bf01c5a7c7fc262a048b008a3835300ec32394ce1433d0327
7
+ data.tar.gz: eecdea6f88d66840f01458088109d17dd92c1555eba022ad8f46fe786852c6811bd4f18d9d11800fcff84decd0fe7a4fc78cb9639aad670637ef776467ddf981
data/HEROKU.md CHANGED
@@ -1,139 +1,134 @@
1
- [S3Search](http://addons.heroku.com/s3search) is an [add-on](http://addons.heroku.com) for providing powerful document-based full-text indexing and search to your application.
1
+ ## S3Search Heroku add-on documentation
2
+
3
+ The [S3Search add-on](http://addons.heroku.com/s3search) provides powerful document-based full-text indexing and search to your application.
2
4
 
3
5
  Adding S3Search to your application will allow you search your documents based upon the actual text within the documents, as well as any metadata fields you assign to them. Yes, that's right! S3Search will index the text inside your documents.
4
6
 
5
7
  Do you already have documents stored and want to index them and make them searchable? No worries. S3Search works by you sending it a URL to fetch the document content to index, along with a hash of metadata attributes to record against it. You can them perform powerful queries against that indexed data, based on the rich features of [elasticsearch](http://www.elasticsearch.org).
6
8
 
7
- S3Search is accessible via an API, or HTTP, and currently has a supported client library for Ruby.
9
+ S3Search is accessible via a supported Ruby API. It also has a HTTP API to support other languages.
8
10
 
9
11
  ## Provisioning the add-on
10
12
 
11
13
  S3Search can be attached to a Heroku application via the CLI:
12
14
 
13
- <div class="callout" markdown="1">
14
- A list of all plans available can be found [here](http://addons.heroku.com/s3search).
15
- </div>
15
+ >A list of all plans available can be found [here](http://addons.heroku.com/s3search).
16
+
16
17
 
17
- :::term
18
+ ````term
18
19
  $ heroku addons:add s3search
19
20
  -----> Adding s3search to sharp-mountain-4005... done, v18 (free)
21
+ ````
22
+ Once S3Search has been added, three new settings will be added to your app configuration: `S3SEARCH_URL`, `S3SEARCH_API_KEY`, and `S3SEARCH_API_SECRET`. This can be confirmed using the `heroku config:get` command.
20
23
 
21
- Once S3Search has been added a `S3SEARCH_URL` setting will be available in the app configuration and will contain your custom URL to access the newly provisioned S3Search service instance. This can be confirmed using the `heroku config:get` command.
22
-
23
- :::term
24
+ ````term
24
25
  $ heroku config:get S3SEARCH_URL
25
- https://user:pass@us-east-1.s3searchapp.com
26
-
26
+ https://us-east-1.s3searchapp.com
27
+ $ heroku config:get S3SEARCH_API_KEY
28
+ 4ef4499b6911fcf89ccb455a92571cb7
29
+ ````
27
30
  After installing S3Search the application should be configured to fully integrate with the add-on.
28
31
 
29
- ## Using with Rails 3.x
32
+ ## Using with Ruby applications
30
33
 
31
34
  Ruby on Rails applications will need to add the following entry into their `Gemfile` specifying the S3Search client library.
32
35
 
33
- :::ruby
36
+ ````ruby
34
37
  gem 's3search'
35
-
38
+ ````
36
39
  Update application dependencies with bundler.
37
40
 
38
- :::term
41
+ ````term
39
42
  $ bundle install
43
+ ````
40
44
 
41
- Write some application code to index some documents.
45
+ ## How it works
42
46
 
43
- :::ruby
44
- S3Search::Document.create title: 'MyDocument', _content_url: 'https://s3-us-east-1.amazonaws.com/my_bucket/my_document.pdf'
45
- S3Search::Document.create name: 'Bob Lob Law', resume_id: 25, _content_url: 'https://s3-us-east-1.amazonaws.com/resumes.mycompany.com/bob.pdf'
46
-
47
+ S3Search uses a special attribute, `_content_url`, to asynchronously index any content you want to associate with a document. `_content_url` is an optional field.
48
+
49
+ When a document is added with a `_content_url` field, it will normally be indexed within a few minutes. Another special field is added to the document, `_is_indexed`, that will be set to true when the indexing of the content located at `_content_url` is complete.
50
+
51
+ If you want to index content that is in a private S3 Bucket, simply use a temporarily authenticated URL for the `_content_url` value. The expiration time of this link should be set to no less than 1 hour.
52
+
53
+ Let's write some application code to index some documents.
54
+
55
+ ````ruby
56
+ S3Search.create title: 'MyDocument', _content_url: 'https://s3-us-east-1.amazonaws.com/my_bucket/my_document.pdf'
57
+ S3Search.create name: 'Bob Lob Law', resume_id: 25, _content_url: 'https://s3-us-east-1.amazonaws.com/resumes.mycompany.com/bob.pdf'
58
+ ````
47
59
  The documents don't even really need to be in S3.
48
60
 
49
- :::ruby
50
- S3Search::Document.create name: 'Bitcoin Pirate', resume_id: 42, _content_url: 'https://user:pass@authenticatedlocation.com/docs/jenny.pdf'
51
- S3Search::Document.create title: 'Bitcoin', author: 'santoshin@gmx.com', tags: ['bitcoin', 'manifesto'], _content_url: 'http://bitcoin.org/bitcoin.pdf'
52
-
61
+ ````ruby
62
+ S3Search.create name: 'Bitcoin Pirate', resume_id: 42, _content_url: 'https://user:pass@authenticatedlocation.com/docs/jenny.pdf'
63
+ S3Search.create title: 'Bitcoin', author: 'santoshin@gmx.com', tags: ['bitcoin', 'manifesto'], _content_url: 'http://bitcoin.org/bitcoin.pdf'
64
+ ````
53
65
  The documents don't even really need to be documents! You can use S3Search to use its powerful search capability over just your custom metadata.
54
66
 
55
- :::ruby
56
- S3Search::Document.create customer_id: 32, first_name: 'His Holiness', last_name: 'The Dalia Lama', religion: 'Buddhist', twitter_handle: '@DalaiLama'
57
- S3Search::Document.create customer_id: 99, first_name: 'George', middle_name: 'R. R.', last_name: 'Martin', job_title: 'Author'
58
-
67
+ ````ruby
68
+ S3Search.create customer_id: 32, first_name: 'His Holiness', last_name: 'The Dalia Lama', religion: 'Buddhist', twitter_handle: '@DalaiLama'
69
+ S3Search.create customer_id: 99, first_name: 'George', middle_name: 'R. R.', last_name: 'Martin', job_title: 'Author'
70
+ ````
59
71
  Now retrieve some documents via the powerful query API.
60
72
 
61
73
  Search by a single metadata field
62
74
 
63
- :::ruby
64
- results = S3Search::Document.search(title: 'MyDocument')
65
-
75
+ ````ruby
76
+ results = S3Search.simple_search('title:MyDocument')
77
+ ````
66
78
  Search all metadata fields AND the content of the documents.
67
79
 
68
- :::ruby
69
- results = S3Search::Document.search('bitcoin')
70
-
80
+ ````ruby
81
+ results = S3Search.simple_search('bitcoin')
82
+ ```
71
83
  Search only the content of the documents.
72
84
 
73
- :::ruby
74
- results = S3Search::Document.search(_document_content: 'bitcoin')
75
-
85
+ ````ruby
86
+ results = S3Search.simplesearch('_document_content:bitcoin')
87
+ ````
76
88
  Boost the search ranking of a certain field.
77
89
 
78
- :::ruby
79
- results = S3Search::Document.search('bitcoin', boost: { title: 2.5 })
80
-
90
+ ````ruby
91
+ results = S3Search.search(where: {_all: 'bitcoin'}, boost: { title: 2.5 })
92
+ ````
81
93
  Find a single document based on its unique id.
82
94
 
83
- :::ruby
84
- document = S3Search::Document.get '833FCA4EEEF2943AC2D8E0'
85
-
86
- ## Monitoring & Logging
87
-
88
- Stats and the current state of S3Search can be displayed via the CLI.
89
-
90
- :::term
91
- $ heroku s3search:status
92
- documents_indexed: 32842
93
- index_size: 640MB
94
-
95
- S3Search activity can be observed within the Heroku log-stream.
96
-
97
- :::term
98
- $ heroku logs -t | grep 's3search'
95
+ ````ruby
96
+ document = S3Search.get '833FCA4EEEF2943AC2D8E0'
97
+ ````
99
98
 
100
99
  ## Dashboard
101
100
 
102
- <div class="callout" markdown="1">
103
- For more information on the features available within the S3Search dashboard please see the docs at [heroku.s3searchapp.com/docs](heroku.s3searchapp.com/docs).
104
- </div>
105
-
106
101
  The S3Search dashboard allows you to view the current status of your S3Search cluster.
107
102
 
108
103
  The dashboard can be accessed via the CLI:
109
104
 
110
- :::term
105
+ ````term
111
106
  $ heroku addons:open s3search
112
- Opening s3search for sharp-mountain-4005
113
-
107
+ Opening s3search for sharp-mountain-4005...
108
+ ````
114
109
  or by visiting the [Heroku apps web interface](http://heroku.com/myapps) and selecting the application in question. Select S3Search from the Add-ons menu.
115
110
 
116
111
  ## Migrating between plans
117
112
 
118
- <div class="note" markdown="1">Application owners should carefully manage the migration timing to ensure proper application function during the migration process.</div>
113
+ >Application owners should carefully manage the migration timing to ensure proper application function during the migration process
119
114
 
120
115
  Use the `heroku addons:upgrade` command to migrate to a new plan.
121
116
 
122
- :::term
117
+ ````term
123
118
  $ heroku addons:upgrade s3search:newplan
124
119
  -----> Upgrading s3search:newplan to sharp-mountain-4005... done, v18 ($49/mo)
125
120
  Your plan has been updated to: s3search:newplan
126
-
121
+ ````
127
122
  ## Removing the add-on
128
123
 
129
124
  S3Search can be removed via the CLI.
130
125
 
131
126
  <div class="warning" markdown="1">This will destroy all metadata and indexes stored in S3Search and cannot be undone! Of course, documents indexed in S3Search but stored elsewhere will remain untouched.</div>
132
127
 
133
- :::term
128
+ ````term
134
129
  $ heroku addons:remove s3search
135
130
  -----> Removing s3search from sharp-mountain-4005... done, v20 (free)
136
-
131
+ ````
137
132
  Before removing S3Search a data export can be performed by contacting support@s3searchapp.com directly.
138
133
 
139
134
  ## Support
data/README.md CHANGED
@@ -35,7 +35,7 @@ Once S3Search has been added a `S3SEARCH_URL` setting will be available in the a
35
35
 
36
36
  ```term
37
37
  $ heroku config:get S3SEARCH_URL
38
- https://user:pass@us-east-1.s3searchapp.com
38
+ https://user:pass@us-east-1.s3search.io
39
39
  ```
40
40
 
41
41
  After installing S3Search the application should be configured to fully integrate with the add-on.
@@ -124,7 +124,7 @@ S3Search activity can be observed within the Heroku log-stream.
124
124
  ## Dashboard
125
125
 
126
126
  <div class="callout" markdown="1">
127
- For more information on the features available within the S3Search dashboard please see the docs at [heroku.s3searchapp.com/docs](heroku.s3searchapp.com/docs).
127
+ For more information on the features available within the S3Search dashboard please see the docs at [heroku.s3search.io/docs](heroku.s3search.io/docs).
128
128
  </div>
129
129
 
130
130
  The S3Search dashboard allows you to view the current status of your S3Search cluster.
@@ -161,11 +161,11 @@ S3Search can be removed via the CLI.
161
161
  -----> Removing s3search from sharp-mountain-4005... done, v20 (free)
162
162
  ```
163
163
 
164
- Before removing S3Search a data export can be performed by contacting support@s3searchapp.com directly.
164
+ Before removing S3Search a data export can be performed by contacting support@s3search.io directly.
165
165
 
166
166
  ## Support
167
167
 
168
- All S3Search support and runtime issues should be submitted via on of the [Heroku Support channels](support-channels). Any non-support related issues or product feedback is welcome at feedback@s3searchapp.com.
168
+ All S3Search support and runtime issues should be submitted via on of the [Heroku Support channels](support-channels). Any non-support related issues or product feedback is welcome at feedback@s3search.io.
169
169
 
170
170
 
171
171
  ## Contributing
@@ -18,8 +18,8 @@ module S3Search
18
18
  attr_reader :url, :http, :logger
19
19
 
20
20
  def initialize
21
- @url = ENV['S3SEARCH_URL'] || 'https://us-east-1.s3searchapp.com'
22
- @http = Faraday.new(:url => @url) do |builder|
21
+ @url = ENV['S3SEARCH_URL'] || 'https://us-east-1.s3search.io'
22
+ @http = Faraday.new(url: @url, ssl: {verify: false}) do |builder|
23
23
  builder.response :mashify
24
24
  builder.response :json, :content_type => /\bjson$/
25
25
  builder.request :json
@@ -1,3 +1,3 @@
1
1
  module S3Search
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Aitchison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-21 00:00:00.000000000 Z
11
+ date: 2013-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport