zigexn_solr-ruby 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +13 -0
- data/lib/solr/connection.rb +4 -0
- data/lib/solr/request/mlt.rb +37 -0
- data/lib/solr/request.rb +1 -0
- data/lib/solr/response/mlt.rb +10 -0
- data/lib/solr/response.rb +2 -1
- metadata +105 -79
- checksums.yaml +0 -7
data/README.md
CHANGED
@@ -30,6 +30,19 @@ After checking out the repo, run `bin/setup` to install dependencies. You can al
|
|
30
30
|
|
31
31
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
32
|
|
33
|
+
## Publish to [rubygems.org](https://rubygems.org)
|
34
|
+
|
35
|
+
```
|
36
|
+
% gem push zigexn_solr-ruby-0.0.1.gem
|
37
|
+
Enter your RubyGems.org credentials.
|
38
|
+
Don't have an account yet? Create one at https://rubygems.org/sign_up
|
39
|
+
Email: g-dev@zigexn.co.jp
|
40
|
+
Password:
|
41
|
+
|
42
|
+
Signed in.
|
43
|
+
Pushing gem to https://rubygems.org...
|
44
|
+
```
|
45
|
+
|
33
46
|
## Contributing
|
34
47
|
|
35
48
|
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/zigexn_solr-ruby.
|
data/lib/solr/connection.rb
CHANGED
@@ -144,6 +144,10 @@ class Solr::Connection
|
|
144
144
|
def info
|
145
145
|
send(Solr::Request::IndexInfo.new)
|
146
146
|
end
|
147
|
+
|
148
|
+
def more_like_this(params, &action)
|
149
|
+
create_and_send_query(Solr::Request::Mlt, params, &action)
|
150
|
+
end
|
147
151
|
|
148
152
|
# send a given Solr::Request and return a RubyResponse or XmlResponse
|
149
153
|
# depending on the type of request
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'erb'
|
2
|
+
class Solr::Request::Mlt < Solr::Request::Base
|
3
|
+
def initialize(params)
|
4
|
+
@params = params
|
5
|
+
end
|
6
|
+
|
7
|
+
def response_format
|
8
|
+
:ruby
|
9
|
+
end
|
10
|
+
|
11
|
+
def handler
|
12
|
+
'mlt'
|
13
|
+
end
|
14
|
+
|
15
|
+
def content_type
|
16
|
+
'application/x-www-form-urlencoded; charset=utf-8'
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_hash
|
20
|
+
@params.update(:wt => 'ruby')
|
21
|
+
end
|
22
|
+
|
23
|
+
def to_s
|
24
|
+
raw_params = self.to_hash
|
25
|
+
|
26
|
+
http_params = []
|
27
|
+
raw_params.each do |key,value|
|
28
|
+
if value.respond_to?(:each) && !value.is_a?(String)
|
29
|
+
value.each { |v| http_params << "#{key}=#{ERB::Util::url_encode(v)}" unless v.nil?}
|
30
|
+
else
|
31
|
+
http_params << "#{key}=#{ERB::Util::url_encode(value)}" unless value.nil?
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
http_params.join("&")
|
36
|
+
end
|
37
|
+
end
|
data/lib/solr/request.rb
CHANGED
data/lib/solr/response.rb
CHANGED
metadata
CHANGED
@@ -1,119 +1,145 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: zigexn_solr-ruby
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
5
11
|
platform: ruby
|
6
|
-
authors:
|
7
|
-
-
|
12
|
+
authors:
|
13
|
+
- ZIGExN
|
8
14
|
autorequire:
|
9
15
|
bindir: exe
|
10
16
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
17
|
+
|
18
|
+
date: 2016-11-23 00:00:00 +07:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
14
22
|
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.12'
|
20
|
-
type: :development
|
21
23
|
prerelease: false
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '10.0'
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 23
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 12
|
33
|
+
version: "1.12"
|
34
34
|
type: :development
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rake
|
35
38
|
prerelease: false
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 35
|
45
|
+
segments:
|
46
|
+
- 10
|
47
|
+
- 0
|
48
|
+
version: "10.0"
|
49
|
+
type: :development
|
50
|
+
version_requirements: *id002
|
41
51
|
description: ZIGExN's fork of the old Apache solr-ruby
|
42
|
-
email:
|
43
|
-
-
|
52
|
+
email:
|
53
|
+
- g-dev@zigexn.co.jp
|
44
54
|
executables: []
|
55
|
+
|
45
56
|
extensions: []
|
57
|
+
|
46
58
|
extra_rdoc_files: []
|
47
|
-
|
59
|
+
|
60
|
+
files:
|
48
61
|
- LICENSE.txt
|
49
62
|
- README.md
|
50
|
-
- lib/solr.rb
|
51
|
-
- lib/solr/connection.rb
|
52
|
-
- lib/solr/document.rb
|
53
63
|
- lib/solr/exception.rb
|
54
|
-
- lib/solr/
|
55
|
-
- lib/solr/importer.rb
|
56
|
-
- lib/solr/importer/array_mapper.rb
|
57
|
-
- lib/solr/importer/delimited_file_source.rb
|
58
|
-
- lib/solr/importer/hpricot_mapper.rb
|
59
|
-
- lib/solr/importer/mapper.rb
|
60
|
-
- lib/solr/importer/solr_source.rb
|
61
|
-
- lib/solr/importer/xpath_mapper.rb
|
64
|
+
- lib/solr/response.rb
|
62
65
|
- lib/solr/indexer.rb
|
63
|
-
- lib/solr/request.rb
|
64
|
-
- lib/solr/request/add_document.rb
|
65
|
-
- lib/solr/request/base.rb
|
66
|
-
- lib/solr/request/commit.rb
|
67
|
-
- lib/solr/request/delete.rb
|
68
|
-
- lib/solr/request/dismax.rb
|
69
|
-
- lib/solr/request/index_info.rb
|
70
|
-
- lib/solr/request/modify_document.rb
|
71
|
-
- lib/solr/request/optimize.rb
|
72
66
|
- lib/solr/request/ping.rb
|
73
|
-
- lib/solr/request/
|
67
|
+
- lib/solr/request/delete.rb
|
74
68
|
- lib/solr/request/spellcheck.rb
|
75
69
|
- lib/solr/request/standard.rb
|
76
70
|
- lib/solr/request/update.rb
|
77
|
-
- lib/solr/
|
71
|
+
- lib/solr/request/add_document.rb
|
72
|
+
- lib/solr/request/base.rb
|
73
|
+
- lib/solr/request/select.rb
|
74
|
+
- lib/solr/request/optimize.rb
|
75
|
+
- lib/solr/request/index_info.rb
|
76
|
+
- lib/solr/request/mlt.rb
|
77
|
+
- lib/solr/request/dismax.rb
|
78
|
+
- lib/solr/request/modify_document.rb
|
79
|
+
- lib/solr/request/commit.rb
|
80
|
+
- lib/solr/importer.rb
|
81
|
+
- lib/solr/util.rb
|
82
|
+
- lib/solr/importer/solr_source.rb
|
83
|
+
- lib/solr/importer/xpath_mapper.rb
|
84
|
+
- lib/solr/importer/mapper.rb
|
85
|
+
- lib/solr/importer/delimited_file_source.rb
|
86
|
+
- lib/solr/importer/array_mapper.rb
|
87
|
+
- lib/solr/importer/hpricot_mapper.rb
|
88
|
+
- lib/solr/response/ping.rb
|
89
|
+
- lib/solr/response/delete.rb
|
90
|
+
- lib/solr/response/spellcheck.rb
|
91
|
+
- lib/solr/response/standard.rb
|
78
92
|
- lib/solr/response/add_document.rb
|
79
93
|
- lib/solr/response/base.rb
|
80
|
-
- lib/solr/response/
|
81
|
-
- lib/solr/response/delete.rb
|
82
|
-
- lib/solr/response/dismax.rb
|
83
|
-
- lib/solr/response/index_info.rb
|
84
|
-
- lib/solr/response/modify_document.rb
|
94
|
+
- lib/solr/response/select.rb
|
85
95
|
- lib/solr/response/optimize.rb
|
86
|
-
- lib/solr/response/
|
96
|
+
- lib/solr/response/index_info.rb
|
87
97
|
- lib/solr/response/ruby.rb
|
88
|
-
- lib/solr/response/
|
89
|
-
- lib/solr/response/spellcheck.rb
|
90
|
-
- lib/solr/response/standard.rb
|
98
|
+
- lib/solr/response/mlt.rb
|
91
99
|
- lib/solr/response/xml.rb
|
100
|
+
- lib/solr/response/dismax.rb
|
101
|
+
- lib/solr/response/modify_document.rb
|
102
|
+
- lib/solr/response/commit.rb
|
103
|
+
- lib/solr/request.rb
|
92
104
|
- lib/solr/solrtasks.rb
|
93
|
-
- lib/solr/
|
105
|
+
- lib/solr/document.rb
|
106
|
+
- lib/solr/connection.rb
|
107
|
+
- lib/solr/field.rb
|
94
108
|
- lib/solr/xml.rb
|
109
|
+
- lib/solr.rb
|
110
|
+
has_rdoc: true
|
95
111
|
homepage: https://github.com/ZIGExN/zigexn_solr-ruby
|
96
|
-
licenses:
|
112
|
+
licenses:
|
97
113
|
- Apache License 2.0
|
98
|
-
metadata: {}
|
99
114
|
post_install_message:
|
100
115
|
rdoc_options: []
|
101
|
-
|
116
|
+
|
117
|
+
require_paths:
|
102
118
|
- lib
|
103
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
-
|
119
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
121
|
+
requirements:
|
105
122
|
- - ">="
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
|
108
|
-
|
109
|
-
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
hash: 3
|
125
|
+
segments:
|
126
|
+
- 0
|
127
|
+
version: "0"
|
128
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
110
131
|
- - ">="
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
hash: 3
|
134
|
+
segments:
|
135
|
+
- 0
|
136
|
+
version: "0"
|
113
137
|
requirements: []
|
138
|
+
|
114
139
|
rubyforge_project:
|
115
|
-
rubygems_version:
|
140
|
+
rubygems_version: 1.3.7
|
116
141
|
signing_key:
|
117
|
-
specification_version:
|
142
|
+
specification_version: 3
|
118
143
|
summary: ZIGExN's fork of the old Apache solr-ruby
|
119
144
|
test_files: []
|
145
|
+
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: aa1bd0ca5581c9884182b920ba9de9e41e015907
|
4
|
-
data.tar.gz: cefc5be187ab53102da3097ba08f7311876ecf0c
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 2c55e63dc374bebca57cfe28e004ba4e59618c26fa689b148d0d7b656fa39c1259bc44f8bcfa240a49577a13631bb1e2bf2f2910792bd6eabef89b1a2da1a539
|
7
|
-
data.tar.gz: 39f0f5ba6d1d14ed1743c18583af570098956416a89c26ff711d923a7affc1daca90838b43a184ebc8faef753a6f442b68e1d69700d0669fe74736fc70de33ed
|