groonga-client-rails 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/text/news.md +6 -0
- data/lib/groonga/client/rails/version.rb +1 -1
- data/lib/groonga/client/searcher/schema.rb +4 -0
- data/lib/groonga/client/searcher/schema_synchronizer.rb +8 -1
- data/test/apps/rails4-mongoid/Gemfile.lock +1 -1
- data/test/apps/rails4-mongoid/app/controllers/posts_controller.rb +7 -1
- data/test/apps/rails4-mongoid/app/models/post.rb +6 -0
- data/test/apps/rails4-mongoid/app/searchers/posts_searcher.rb +5 -0
- data/test/apps/rails4-mongoid/app/views/posts/_form.html.erb +4 -0
- data/test/apps/rails4-mongoid/app/views/posts/index.json.jbuilder +1 -1
- data/test/apps/rails4-mongoid/app/views/posts/show.html.erb +6 -0
- data/test/apps/rails4-mongoid/app/views/posts/show.json.jbuilder +1 -1
- data/test/apps/rails4-mongoid/log/development.log +1576 -0
- data/test/apps/rails4-mongoid/log/test.log +1121 -0
- data/test/apps/rails4-mongoid/test/searchers/posts_searcher_test.rb +26 -0
- metadata +2 -2
@@ -14,6 +14,15 @@ class PostsSearcherTest < ActionController::TestCase
|
|
14
14
|
result_set.records.collect {|record| record["body"]})
|
15
15
|
end
|
16
16
|
|
17
|
+
test "should be save tags" do
|
18
|
+
create(:post, tags: ["tag1", "tag2"])
|
19
|
+
result_set = @searcher.search.result_set
|
20
|
+
assert_equal([
|
21
|
+
["tag1", "tag2"],
|
22
|
+
],
|
23
|
+
result_set.records.collect {|record| record["tags"]})
|
24
|
+
end
|
25
|
+
|
17
26
|
test "should be searchable without match_columns" do
|
18
27
|
create(:post, body: "Hello World")
|
19
28
|
create(:post, body: "Hello Rails")
|
@@ -57,6 +66,23 @@ class PostsSearcherTest < ActionController::TestCase
|
|
57
66
|
result_set.records.collect {|record| record["body"]})
|
58
67
|
end
|
59
68
|
|
69
|
+
test "should be searchable by an element of array" do
|
70
|
+
create(:post, tags: ["tag1", "tag2", "tag3"])
|
71
|
+
create(:post, tags: [])
|
72
|
+
create(:post, tags: ["tag2"])
|
73
|
+
create(:post, tags: ["tag3"])
|
74
|
+
result_set = @searcher.
|
75
|
+
search.
|
76
|
+
filter("tags @ %{tag}", {tag: "tag2"}).
|
77
|
+
sortby("_id").
|
78
|
+
result_set
|
79
|
+
assert_equal([
|
80
|
+
["tag1", "tag2", "tag3"],
|
81
|
+
["tag2"],
|
82
|
+
],
|
83
|
+
result_set.records.collect {|record| record["tags"]})
|
84
|
+
end
|
85
|
+
|
60
86
|
test "should support snippet_html in output_columns" do
|
61
87
|
create(:post, body: "Hello World")
|
62
88
|
create(:post, body: "Hi Rails! Hello!")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: groonga-client-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: groonga-client
|