ansr_blacklight 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile +2 -1
- data/lib/ansr_blacklight/arel/visitors/to_no_sql.rb +2 -2
- data/lib/ansr_blacklight/connection_adapters/no_sql_adapter.rb +3 -2
- data/lib/ansr_blacklight/model/querying.rb +5 -0
- data/lib/ansr_blacklight/relation.rb +1 -1
- data/lib/ansr_blacklight/solr/response.rb +4 -4
- data/spec/lib/relation/faceting_spec.rb +1 -0
- data/spec/lib/relation/grouping_spec.rb +8 -4
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWNiMzkzODkzYzMwMjA5NTllNTVlYTA5Y2RiOTU2YWM1ZDc2ZWUyZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTI4NGU3ZmFlOGMyNmVkMmFjMDA5N2Y4ODg0NjIxODkyZTdmMjUyYg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YWM1ZjEyZGYzZDE5ZjhiOTRlZjhkNTI5ZGRmZDRlYzVmY2U2OThiYjc1YzBm
|
10
|
+
YzgyMmFhMGZiNDUxODMxYmI3OTQ4ODNjNDFjM2JlMzg5MDMzYzAwOTMzOGUw
|
11
|
+
NDE2YTRkYzYwMDA0OWFkZTQ5YzgwZGFkM2NhYjExNTlhOTNiY2U=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDFiZGVkZDdkMWM4MzkyM2UzYWI5Yzk5NjcwNmVhZGY1Zjg3MGU2NzYxY2Fk
|
14
|
+
ZWVlMWE1YTk2YzBjMmI4MDExMGU5MWVlYzVmYjM5MzczOWQyZGQzZmE4ZmY2
|
15
|
+
Mzk5MDVhMDlhMTJlNjc1MTQxZmFjNGU4YWUyZGIyZTRkYWEzZDM=
|
data/Gemfile
CHANGED
@@ -9,6 +9,7 @@ module Ansr::Blacklight::ConnectionAdapters
|
|
9
9
|
super(klass, klass.solr, logger, pool)
|
10
10
|
# the RSolr class has one query method, with the name of the selector the first parm?
|
11
11
|
@method = :send_and_receive
|
12
|
+
@http_method = klass.method
|
12
13
|
@visitor = Ansr::Blacklight::Arel::Visitors::ToNoSql.new(@table)
|
13
14
|
end
|
14
15
|
|
@@ -28,8 +29,8 @@ module Ansr::Blacklight::ConnectionAdapters
|
|
28
29
|
def execute(query, name='ANSR-SOLR')
|
29
30
|
query = query.dup
|
30
31
|
# TODO: execution context to assign :post to params[:method]
|
31
|
-
params = {params: query, method:
|
32
|
-
params[:data] = params.delete(:params) if
|
32
|
+
params = {params: query, method: @http_method}
|
33
|
+
params[:data] = params.delete(:params) if @http_method == :post
|
33
34
|
raw_response = eval(@connection.send(@method, query.path, params))
|
34
35
|
Ansr::Blacklight::Solr::Response.new(raw_response, raw_response['params'])
|
35
36
|
end
|
@@ -16,7 +16,7 @@ class Ansr::Blacklight::Solr::Response < HashWithIndifferentAccess
|
|
16
16
|
@request_params = request_params
|
17
17
|
extend Spelling
|
18
18
|
extend Ansr::Facets
|
19
|
-
extend
|
19
|
+
extend InternalResponse
|
20
20
|
extend MoreLikeThis
|
21
21
|
end
|
22
22
|
|
@@ -64,15 +64,15 @@ class Ansr::Blacklight::Solr::Response < HashWithIndifferentAccess
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
def group key
|
68
|
-
grouped.select { |x| x.key == key }.first
|
67
|
+
def group key, model
|
68
|
+
grouped(model).select { |x| x.key == key }.first
|
69
69
|
end
|
70
70
|
|
71
71
|
def grouped?
|
72
72
|
self.has_key? "grouped"
|
73
73
|
end
|
74
74
|
|
75
|
-
module
|
75
|
+
module InternalResponse
|
76
76
|
def response
|
77
77
|
self[:response] || {}
|
78
78
|
end
|
@@ -69,6 +69,7 @@ describe Ansr::Blacklight do
|
|
69
69
|
subject { FacetModel }
|
70
70
|
|
71
71
|
it "should send a post request to solr and get a response back" do
|
72
|
+
subject.method = :post
|
72
73
|
rel = subject.where(:q => @all_docs_query)
|
73
74
|
subject.solr= stub_solr(JSON.parse(@abc_resp).inspect)
|
74
75
|
expect(rel.length).to be >= 1
|
@@ -42,12 +42,16 @@ describe Ansr::Blacklight do
|
|
42
42
|
rel
|
43
43
|
end
|
44
44
|
|
45
|
-
let(:
|
46
|
-
response.group_by
|
45
|
+
let(:group_response) do
|
46
|
+
response.group_by
|
47
47
|
end
|
48
48
|
|
49
|
-
|
50
|
-
|
49
|
+
let(:groups) do
|
50
|
+
group_response.groups #.first
|
51
|
+
end
|
52
|
+
|
53
|
+
subject do
|
54
|
+
groups.first
|
51
55
|
end
|
52
56
|
|
53
57
|
describe Ansr::Blacklight::Solr::Response::Group do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ansr_blacklight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Armintor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ansr
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0.
|
19
|
+
version: 0.0.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0.
|
26
|
+
version: 0.0.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json-ld
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|