websolr-acts_as_solr 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +69 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/websolr-acts_as_solr.rb +1 -1
- data/websolr-acts_as_solr.gemspec +6 -6
- metadata +4 -4
- data/README +0 -17
data/README.rdoc
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
== About
|
2
|
+
|
3
|
+
This is the gem to install for the supported version of acts_as_solr on websolr.
|
4
|
+
|
5
|
+
== Installation
|
6
|
+
|
7
|
+
cd your_rails_app
|
8
|
+
sudo gem install websolr-acts_as_solr
|
9
|
+
config.gem "websolr-acts_as_solr" # into config.environment.rb
|
10
|
+
echo websolr-acts_as_solr >> .gems # if using Heroku
|
11
|
+
acts_as_solr install # Installs config/solr.yml
|
12
|
+
echo "require 'aas_tasks'" >> Rakefile # Installs local development tasks
|
13
|
+
|
14
|
+
== Usage
|
15
|
+
|
16
|
+
=== Starting a local development server
|
17
|
+
|
18
|
+
To start up a Solr instance for development, issue the following:
|
19
|
+
|
20
|
+
rake solr:start
|
21
|
+
|
22
|
+
=== Using in production
|
23
|
+
|
24
|
+
You need to make sure that the WEBSOLR_URL environment variable is set correctly.
|
25
|
+
|
26
|
+
If you're using Heroku, this should happen automatically. You can verify by running <code>heroku config</code>.
|
27
|
+
|
28
|
+
If you're running in your own environment, set the environment variable as you normally would on a *nix system.
|
29
|
+
|
30
|
+
If you have to set the variable in Ruby, you should be able to put the following in an Rails initializer:
|
31
|
+
|
32
|
+
if RAILS_ENV == "production"
|
33
|
+
ENV["WEBSOLR_URL"] = "http://index.websolr.com/solr/[your-api-key]"
|
34
|
+
load "websolr-acts_as_solr.rb"
|
35
|
+
end
|
36
|
+
|
37
|
+
== Requirements
|
38
|
+
|
39
|
+
* Java Runtime Environment(JRE) 1.5 aka 5.0 [http://www.java.com/en/download/index.jsp](http://www.java.com/en/download/index.jsp)
|
40
|
+
* If you have libxml-ruby installed, make sure it's at least version 0.7
|
41
|
+
|
42
|
+
== Basic Usage
|
43
|
+
|
44
|
+
# Just include the line below to any of your ActiveRecord models:
|
45
|
+
acts_as_solr
|
46
|
+
|
47
|
+
# Or if you want, you can specify only the fields that should be indexed:
|
48
|
+
acts_as_solr :fields => [:name, :author]
|
49
|
+
|
50
|
+
# Then to find instances of your model, just do:
|
51
|
+
Model.find_by_solr(query) #query is a string representing your query
|
52
|
+
|
53
|
+
# Please see ActsAsSolr::ActsMethods for a complete info
|
54
|
+
|
55
|
+
== acts_as_solr in your tests
|
56
|
+
|
57
|
+
To test code that uses acts_as_solr you must start a Solr server for the test environment. You can do that with
|
58
|
+
|
59
|
+
rake solr:start RAILS_ENV=test
|
60
|
+
|
61
|
+
However, if you would like to mock out Solr calls so that a Solr server is not needed (and your tests will run much faster), just add this to your `test_helper.rb` or similar:
|
62
|
+
|
63
|
+
class ActsAsSolr::Post
|
64
|
+
def self.execute(request)
|
65
|
+
true
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
(via[http://www.subelsky.com/2007/10/actsassolr-capistranhttpwwwbloggercomim.html#c1646308013209805416])
|
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ begin
|
|
10
10
|
gem.email = "kyle@kylemaxwell.com"
|
11
11
|
gem.homepage = "http://github.com/fizx/websolr-acts_as_solr"
|
12
12
|
gem.authors = ["Kyle Maxwell"]
|
13
|
-
gem.add_dependency "acts_as_solr", "1.
|
13
|
+
gem.add_dependency "acts_as_solr", "1.2.0"
|
14
14
|
gem.add_dependency "rest-client"
|
15
15
|
gem.add_dependency "json"
|
16
16
|
gem.add_development_dependency "rspec", ">= 0"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
data/lib/websolr-acts_as_solr.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{websolr-acts_as_solr}
|
8
|
-
s.version = "0.0
|
8
|
+
s.version = "0.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kyle Maxwell"]
|
@@ -14,13 +14,13 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.email = %q{kyle@kylemaxwell.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
|
-
"README"
|
17
|
+
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
21
|
".gitignore",
|
22
22
|
"LICENSE",
|
23
|
-
"README",
|
23
|
+
"README.rdoc",
|
24
24
|
"Rakefile",
|
25
25
|
"VERSION",
|
26
26
|
"lib/websolr-acts_as_solr.rb",
|
@@ -43,18 +43,18 @@ Gem::Specification.new do |s|
|
|
43
43
|
s.specification_version = 3
|
44
44
|
|
45
45
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
46
|
-
s.add_runtime_dependency(%q<acts_as_solr>, ["= 1.
|
46
|
+
s.add_runtime_dependency(%q<acts_as_solr>, ["= 1.2.0"])
|
47
47
|
s.add_runtime_dependency(%q<rest-client>, [">= 0"])
|
48
48
|
s.add_runtime_dependency(%q<json>, [">= 0"])
|
49
49
|
s.add_development_dependency(%q<rspec>, [">= 0"])
|
50
50
|
else
|
51
|
-
s.add_dependency(%q<acts_as_solr>, ["= 1.
|
51
|
+
s.add_dependency(%q<acts_as_solr>, ["= 1.2.0"])
|
52
52
|
s.add_dependency(%q<rest-client>, [">= 0"])
|
53
53
|
s.add_dependency(%q<json>, [">= 0"])
|
54
54
|
s.add_dependency(%q<rspec>, [">= 0"])
|
55
55
|
end
|
56
56
|
else
|
57
|
-
s.add_dependency(%q<acts_as_solr>, ["= 1.
|
57
|
+
s.add_dependency(%q<acts_as_solr>, ["= 1.2.0"])
|
58
58
|
s.add_dependency(%q<rest-client>, [">= 0"])
|
59
59
|
s.add_dependency(%q<json>, [">= 0"])
|
60
60
|
s.add_dependency(%q<rspec>, [">= 0"])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: websolr-acts_as_solr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Maxwell
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - "="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 1.
|
23
|
+
version: 1.2.0
|
24
24
|
version:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rest-client
|
@@ -60,12 +60,12 @@ extensions: []
|
|
60
60
|
|
61
61
|
extra_rdoc_files:
|
62
62
|
- LICENSE
|
63
|
-
- README
|
63
|
+
- README.rdoc
|
64
64
|
files:
|
65
65
|
- .document
|
66
66
|
- .gitignore
|
67
67
|
- LICENSE
|
68
|
-
- README
|
68
|
+
- README.rdoc
|
69
69
|
- Rakefile
|
70
70
|
- VERSION
|
71
71
|
- lib/websolr-acts_as_solr.rb
|
data/README
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
Changes:
|
2
|
-
- Split the acts_as_solr, and websolr_rails versions of the gem. This is acts_as_solr-only.
|
3
|
-
- Lockdown the specific supported versions of acts_as_solr
|
4
|
-
- Web service call on boot to enforce the correct schema.xml.
|
5
|
-
|
6
|
-
Using the experimental websolr acts_as_solr client:
|
7
|
-
|
8
|
-
sudo gem install websolr-acts_as_solr
|
9
|
-
echo websolr-acts_as_solr >> .gems
|
10
|
-
config.gem "websolr-acts_as_solr" # into config/environment.rb
|
11
|
-
|
12
|
-
Edit config/solr.yml =>
|
13
|
-
|
14
|
-
development:
|
15
|
-
url: http://127.0.0.1:8982/solr
|
16
|
-
|
17
|
-
Use acts_as_solr as usual.
|