solr_mapper 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +1 -1
- data/README.rdoc +8 -8
- data/Rakefile +1 -1
- data/lib/solr_mapper/solr_document.rb +13 -0
- data/solr_mapper.gemspec +3 -3
- data/spec/base.rb +6 -6
- data/spec/url_spec.rb +4 -4
- metadata +5 -5
data/Manifest
CHANGED
data/README.rdoc
CHANGED
@@ -14,16 +14,16 @@ gem install solr_mapper
|
|
14
14
|
|
15
15
|
class Stuff
|
16
16
|
include SolrDocument
|
17
|
-
|
18
|
-
|
17
|
+
bind_service_url = 'http://localhost:8080/solr/stuff'
|
18
|
+
limit_page_size 25
|
19
19
|
|
20
20
|
belongs_to :thing
|
21
21
|
end
|
22
22
|
|
23
23
|
class Widget
|
24
24
|
include SolrDocument
|
25
|
-
|
26
|
-
|
25
|
+
bind_service_url 'http://localhost:8080/solr/widget'
|
26
|
+
limit_page_size 15
|
27
27
|
|
28
28
|
belongs_to :thing
|
29
29
|
end
|
@@ -32,13 +32,13 @@ gem install solr_mapper
|
|
32
32
|
include SolrDocument
|
33
33
|
|
34
34
|
# base urls can also be defined by rails environments
|
35
|
-
|
35
|
+
bind_service_url({
|
36
36
|
:development => 'http://somehost/solr_thing',
|
37
37
|
:test => 'http://localhost:8080/solr_thing',
|
38
|
-
:production => 'http://
|
39
|
-
}
|
38
|
+
:production => 'http://livebox/solr/thing'
|
39
|
+
})
|
40
40
|
|
41
|
-
|
41
|
+
limit_page_size 10
|
42
42
|
|
43
43
|
has_many :stuffs
|
44
44
|
has_one :widget
|
data/Rakefile
CHANGED
@@ -16,7 +16,7 @@ require 'rubygems'
|
|
16
16
|
require 'rake'
|
17
17
|
require 'echoe'
|
18
18
|
|
19
|
-
Echoe.new('solr_mapper', '0.1.
|
19
|
+
Echoe.new('solr_mapper', '0.1.7') do |p|
|
20
20
|
p.description = "Object Document Mapper for the Apache Foundation's Solr search platform"
|
21
21
|
p.url = "http://github.com/skunkworx/solr_mapper"
|
22
22
|
p.author = "Chris Umbel"
|
@@ -25,6 +25,19 @@ module SolrMapper
|
|
25
25
|
attr_accessor :per_page
|
26
26
|
attr_accessor :solr_fields
|
27
27
|
|
28
|
+
def limit_page_size(val)
|
29
|
+
@per_page = val
|
30
|
+
end
|
31
|
+
|
32
|
+
def bind_service_url(val)
|
33
|
+
@base_url = val
|
34
|
+
@base_url = ActiveSupport::HashWithIndifferentAccess.new(@base_url) if @base_url.instance_of?(Hash)
|
35
|
+
end
|
36
|
+
|
37
|
+
def service_url
|
38
|
+
@base_url
|
39
|
+
end
|
40
|
+
|
28
41
|
# send a read REST command to Solr
|
29
42
|
def execute_read(opts)
|
30
43
|
url = build_url('select', opts.merge(:wt => 'ruby'))
|
data/solr_mapper.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{solr_mapper}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.7"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Chris Umbel"]
|
9
|
-
s.date = %q{2010-10-
|
9
|
+
s.date = %q{2010-10-30}
|
10
10
|
s.description = %q{Object Document Mapper for the Apache Foundation's Solr search platform}
|
11
11
|
s.email = %q{chrisu@dvdempire.com}
|
12
12
|
s.extra_rdoc_files = ["LICENSE.txt", "README.rdoc", "lib/solr_mapper.rb", "lib/solr_mapper/calculations.rb", "lib/solr_mapper/locators.rb", "lib/solr_mapper/relations.rb", "lib/solr_mapper/solr_document.rb"]
|
13
|
-
s.files = ["LICENSE.txt", "README.rdoc", "Rakefile", "lib/solr_mapper.rb", "lib/solr_mapper/calculations.rb", "lib/solr_mapper/locators.rb", "lib/solr_mapper/relations.rb", "lib/solr_mapper/solr_document.rb", "solr_mapper.gemspec", "spec/base.rb", "spec/calculations_spec.rb", "spec/facets_spec.rb", "spec/locators_spec.rb", "spec/misc_spec.rb", "spec/paginated_spec.rb", "spec/query_spec.rb", "spec/relation_spec.rb", "spec/solr/stuff/config/schema.xml", "spec/solr/thing/config/schema.xml", "spec/solr/widget/conf/schema.xml", "spec/url_spec.rb"
|
13
|
+
s.files = ["LICENSE.txt", "Manifest", "README.rdoc", "Rakefile", "lib/solr_mapper.rb", "lib/solr_mapper/calculations.rb", "lib/solr_mapper/locators.rb", "lib/solr_mapper/relations.rb", "lib/solr_mapper/solr_document.rb", "solr_mapper.gemspec", "spec/base.rb", "spec/calculations_spec.rb", "spec/facets_spec.rb", "spec/locators_spec.rb", "spec/misc_spec.rb", "spec/paginated_spec.rb", "spec/query_spec.rb", "spec/relation_spec.rb", "spec/solr/stuff/config/schema.xml", "spec/solr/thing/config/schema.xml", "spec/solr/widget/conf/schema.xml", "spec/url_spec.rb"]
|
14
14
|
s.homepage = %q{http://github.com/skunkworx/solr_mapper}
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Solr_mapper", "--main", "README.rdoc"]
|
16
16
|
s.require_paths = ["lib"]
|
data/spec/base.rb
CHANGED
@@ -21,24 +21,24 @@ include SolrMapper
|
|
21
21
|
|
22
22
|
class Stuff
|
23
23
|
include SolrDocument
|
24
|
-
|
25
|
-
|
24
|
+
bind_service_url 'http://localhost:8080/solr_stuff'
|
25
|
+
limit_page_size 10
|
26
26
|
|
27
27
|
belongs_to :thing
|
28
28
|
end
|
29
29
|
|
30
30
|
class Widget
|
31
31
|
include SolrDocument
|
32
|
-
|
33
|
-
|
32
|
+
bind_service_url 'http://localhost:8080/solr_widget'
|
33
|
+
limit_page_size 10
|
34
34
|
|
35
35
|
belongs_to :thing
|
36
36
|
end
|
37
37
|
|
38
38
|
class Thing
|
39
39
|
include SolrDocument
|
40
|
-
|
41
|
-
|
40
|
+
bind_service_url 'http://localhost:8080/solr_thing'
|
41
|
+
limit_page_size 10
|
42
42
|
|
43
43
|
has_many :stuffs
|
44
44
|
has_one :widget
|
data/spec/url_spec.rb
CHANGED
@@ -37,11 +37,11 @@ describe SolrDocument do
|
|
37
37
|
|
38
38
|
class AnotherThing
|
39
39
|
include SolrDocument
|
40
|
-
|
40
|
+
bind_service_url({
|
41
41
|
:development => 'http://somehost/solr_thing',
|
42
42
|
:test => 'http://localhost:8080/solr_thing',
|
43
43
|
:production => 'http://somehost/solr_thing'
|
44
|
-
}
|
44
|
+
})
|
45
45
|
end
|
46
46
|
|
47
47
|
AnotherThing.build_url('select').should == 'http://localhost:8080/solr_thing/select'
|
@@ -52,11 +52,11 @@ describe SolrDocument do
|
|
52
52
|
|
53
53
|
class AnotherThing
|
54
54
|
include SolrDocument
|
55
|
-
|
55
|
+
bind_service_url({
|
56
56
|
'development' => 'http://somehost/solr_thing',
|
57
57
|
'test' => 'http://localhost:8080/solr_thing',
|
58
58
|
'production' => 'http://somehost/solr_thing'
|
59
|
-
}
|
59
|
+
})
|
60
60
|
end
|
61
61
|
|
62
62
|
AnotherThing.build_url('select').should == 'http://localhost:8080/solr_thing/select'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solr_mapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 7
|
10
|
+
version: 0.1.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chris Umbel
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-30 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -90,6 +90,7 @@ extra_rdoc_files:
|
|
90
90
|
- lib/solr_mapper/solr_document.rb
|
91
91
|
files:
|
92
92
|
- LICENSE.txt
|
93
|
+
- Manifest
|
93
94
|
- README.rdoc
|
94
95
|
- Rakefile
|
95
96
|
- lib/solr_mapper.rb
|
@@ -110,7 +111,6 @@ files:
|
|
110
111
|
- spec/solr/thing/config/schema.xml
|
111
112
|
- spec/solr/widget/conf/schema.xml
|
112
113
|
- spec/url_spec.rb
|
113
|
-
- Manifest
|
114
114
|
has_rdoc: true
|
115
115
|
homepage: http://github.com/skunkworx/solr_mapper
|
116
116
|
licenses: []
|