riddle 0.9.8.1533.10 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +1 -0
- data/lib/riddle.rb +9 -15
- data/lib/riddle/0.9.8.rb +0 -0
- data/lib/riddle/0.9.9.rb +5 -0
- data/lib/riddle/0.9.9/client.rb +49 -0
- data/lib/riddle/0.9.9/client/filter.rb +22 -0
- data/lib/riddle/0.9.9/configuration/searchd.rb +28 -0
- data/lib/riddle/client.rb +110 -18
- data/lib/riddle/client/filter.rb +29 -20
- data/lib/riddle/client/message.rb +4 -0
- data/lib/riddle/client/response.rb +10 -0
- data/lib/riddle/configuration/distributed_index.rb +8 -7
- data/lib/riddle/configuration/index.rb +15 -11
- data/lib/riddle/configuration/searchd.rb +6 -4
- data/lib/riddle/configuration/sql_source.rb +9 -4
- data/lib/riddle/controller.rb +5 -3
- data/spec/fixtures/data_generator.0.9.8.php +208 -0
- data/spec/fixtures/data_generator.0.9.9.php +225 -0
- data/spec/fixtures/sphinx/configuration.erb +38 -0
- data/spec/fixtures/sphinx/people.spa +0 -0
- data/spec/fixtures/sphinx/people.spd +0 -0
- data/spec/fixtures/sphinx/people.sph +0 -0
- data/spec/fixtures/sphinx/people.spi +0 -0
- data/spec/fixtures/sphinx/people.spk +0 -0
- data/spec/fixtures/sphinx/people.spm +0 -0
- data/spec/fixtures/sphinx/people.spp +0 -0
- data/spec/fixtures/sphinx/searchd.log +3731 -0
- data/spec/fixtures/sphinx/searchd.query.log +1032 -0
- data/spec/fixtures/sphinx/spec.conf +38 -0
- data/spec/fixtures/sphinxapi.0.9.8.php +1228 -0
- data/spec/fixtures/sphinxapi.0.9.9.php +1646 -0
- data/spec/fixtures/sql/conf.example.yml +3 -0
- data/spec/fixtures/sql/conf.yml +3 -0
- data/spec/fixtures/sql/data.sql +25000 -0
- data/spec/fixtures/sql/structure.sql +16 -0
- data/spec/functional/excerpt_spec.rb +37 -10
- data/spec/functional/persistance_spec.rb +17 -0
- data/spec/functional/status_spec.rb +21 -0
- data/spec/functional/update_spec.rb +3 -3
- data/spec/spec_helper.rb +30 -0
- data/spec/sphinx_helper.rb +93 -0
- data/spec/unit/client_spec.rb +20 -3
- data/spec/unit/configuration/distributed_index_spec.rb +2 -0
- data/spec/unit/configuration/index_spec.rb +16 -0
- data/spec/unit/configuration/searchd_spec.rb +46 -13
- data/spec/unit/configuration/sql_source_spec.rb +15 -0
- metadata +61 -37
- data/MIT-LICENCE +0 -20
- data/lib/tabtab_definitions.rb +0 -15
@@ -52,8 +52,10 @@ describe Riddle::Configuration::SQLSource do
|
|
52
52
|
source.sql_query = "SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content FROM documents WHERE id >= $start AND id <= $end"
|
53
53
|
source.sql_query_range = "SELECT MIN(id), MAX(id) FROM documents"
|
54
54
|
source.sql_range_step = 1000
|
55
|
+
source.sql_query_killlist = "SELECT id FROM documents WHERE edited>=@last_reindex"
|
55
56
|
source.sql_attr_uint << "author_id" << "forum_id:9" << "group_id"
|
56
57
|
source.sql_attr_bool << "is_deleted"
|
58
|
+
source.sql_attr_bigint << "my_bigint_id"
|
57
59
|
source.sql_attr_timestamp << "posted_ts" << "last_edited_ts" << "date_added"
|
58
60
|
source.sql_attr_str2ordinal << "author_name"
|
59
61
|
source.sql_attr_float << "lat_radians" << "long_radians"
|
@@ -62,6 +64,11 @@ describe Riddle::Configuration::SQLSource do
|
|
62
64
|
source.sql_query_post_index = "REPLACE INTO counters (id, val) VALUES ('max_indexed_id', $maxid)"
|
63
65
|
source.sql_ranged_throttle = 0
|
64
66
|
source.sql_query_info = "SELECT * FROM documents WHERE id = $id"
|
67
|
+
source.mssql_winauth = 1
|
68
|
+
source.mssql_unicode = 1
|
69
|
+
source.unpack_zlib << "zlib_column"
|
70
|
+
source.unpack_mysqlcompress << "compressed_column" << "compressed_column_2"
|
71
|
+
source.unpack_mysqlcompress_maxsize = "16M"
|
65
72
|
|
66
73
|
source.render.should == <<-SQLSOURCE
|
67
74
|
source src1
|
@@ -79,10 +86,12 @@ source src1
|
|
79
86
|
sql_query = SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content FROM documents WHERE id >= $start AND id <= $end
|
80
87
|
sql_query_range = SELECT MIN(id), MAX(id) FROM documents
|
81
88
|
sql_range_step = 1000
|
89
|
+
sql_query_killlist = SELECT id FROM documents WHERE edited>=@last_reindex
|
82
90
|
sql_attr_uint = author_id
|
83
91
|
sql_attr_uint = forum_id:9
|
84
92
|
sql_attr_uint = group_id
|
85
93
|
sql_attr_bool = is_deleted
|
94
|
+
sql_attr_bigint = my_bigint_id
|
86
95
|
sql_attr_timestamp = posted_ts
|
87
96
|
sql_attr_timestamp = last_edited_ts
|
88
97
|
sql_attr_timestamp = date_added
|
@@ -94,6 +103,12 @@ source src1
|
|
94
103
|
sql_query_post_index = REPLACE INTO counters (id, val) VALUES ('max_indexed_id', $maxid)
|
95
104
|
sql_ranged_throttle = 0
|
96
105
|
sql_query_info = SELECT * FROM documents WHERE id = $id
|
106
|
+
mssql_winauth = 1
|
107
|
+
mssql_unicode = 1
|
108
|
+
unpack_zlib = zlib_column
|
109
|
+
unpack_mysqlcompress = compressed_column
|
110
|
+
unpack_mysqlcompress = compressed_column_2
|
111
|
+
unpack_mysqlcompress_maxsize = 16M
|
97
112
|
}
|
98
113
|
SQLSOURCE
|
99
114
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riddle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pat Allan
|
@@ -9,23 +9,50 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09
|
12
|
+
date: 2009-11-09 00:00:00 +11:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rspec
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.2.9
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: yard
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
35
|
+
description: A Ruby API and configuration helper for the Sphinx search service.
|
17
36
|
email: pat@freelancing-gods.com
|
18
37
|
executables: []
|
19
38
|
|
20
39
|
extensions: []
|
21
40
|
|
22
|
-
extra_rdoc_files:
|
23
|
-
|
41
|
+
extra_rdoc_files:
|
42
|
+
- README.textile
|
24
43
|
files:
|
44
|
+
- README.textile
|
45
|
+
- lib/riddle.rb
|
46
|
+
- lib/riddle/0.9.8.rb
|
47
|
+
- lib/riddle/0.9.9.rb
|
48
|
+
- lib/riddle/0.9.9/client.rb
|
49
|
+
- lib/riddle/0.9.9/client/filter.rb
|
50
|
+
- lib/riddle/0.9.9/configuration/searchd.rb
|
51
|
+
- lib/riddle/client.rb
|
25
52
|
- lib/riddle/client/filter.rb
|
26
53
|
- lib/riddle/client/message.rb
|
27
54
|
- lib/riddle/client/response.rb
|
28
|
-
- lib/riddle/
|
55
|
+
- lib/riddle/configuration.rb
|
29
56
|
- lib/riddle/configuration/distributed_index.rb
|
30
57
|
- lib/riddle/configuration/index.rb
|
31
58
|
- lib/riddle/configuration/indexer.rb
|
@@ -35,40 +62,14 @@ files:
|
|
35
62
|
- lib/riddle/configuration/source.rb
|
36
63
|
- lib/riddle/configuration/sql_source.rb
|
37
64
|
- lib/riddle/configuration/xml_source.rb
|
38
|
-
- lib/riddle/configuration.rb
|
39
65
|
- lib/riddle/controller.rb
|
40
|
-
- lib/riddle.rb
|
41
|
-
- lib/tabtab_definitions.rb
|
42
|
-
- MIT-LICENCE
|
43
|
-
- README.textile
|
44
|
-
- spec/functional/excerpt_spec.rb
|
45
|
-
- spec/functional/keywords_spec.rb
|
46
|
-
- spec/functional/search_spec.rb
|
47
|
-
- spec/functional/update_spec.rb
|
48
|
-
- spec/unit/client_spec.rb
|
49
|
-
- spec/unit/configuration/distributed_index_spec.rb
|
50
|
-
- spec/unit/configuration/index_spec.rb
|
51
|
-
- spec/unit/configuration/indexer_spec.rb
|
52
|
-
- spec/unit/configuration/searchd_spec.rb
|
53
|
-
- spec/unit/configuration/source_spec.rb
|
54
|
-
- spec/unit/configuration/sql_source_spec.rb
|
55
|
-
- spec/unit/configuration/xml_source_spec.rb
|
56
|
-
- spec/unit/configuration_spec.rb
|
57
|
-
- spec/unit/filter_spec.rb
|
58
|
-
- spec/unit/message_spec.rb
|
59
|
-
- spec/unit/response_spec.rb
|
60
|
-
- spec/unit/riddle_spec.rb
|
61
66
|
has_rdoc: true
|
62
67
|
homepage: http://riddle.freelancing-gods.com
|
63
68
|
licenses: []
|
64
69
|
|
65
70
|
post_install_message:
|
66
71
|
rdoc_options:
|
67
|
-
- --
|
68
|
-
- Riddle -- Ruby Sphinx Client
|
69
|
-
- --main
|
70
|
-
- Riddle::Client
|
71
|
-
- --line-numbers
|
72
|
+
- --charset=UTF-8
|
72
73
|
require_paths:
|
73
74
|
- lib
|
74
75
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -85,16 +86,39 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
86
|
version:
|
86
87
|
requirements: []
|
87
88
|
|
88
|
-
rubyforge_project:
|
89
|
+
rubyforge_project:
|
89
90
|
rubygems_version: 1.3.5
|
90
91
|
signing_key:
|
91
92
|
specification_version: 3
|
92
|
-
summary: API for Sphinx, written in and for Ruby.
|
93
|
+
summary: An API for Sphinx, written in and for Ruby.
|
93
94
|
test_files:
|
95
|
+
- spec/fixtures/data_generator.0.9.8.php
|
96
|
+
- spec/fixtures/data_generator.0.9.9.php
|
97
|
+
- spec/fixtures/sphinx/configuration.erb
|
98
|
+
- spec/fixtures/sphinx/people.spa
|
99
|
+
- spec/fixtures/sphinx/people.spd
|
100
|
+
- spec/fixtures/sphinx/people.sph
|
101
|
+
- spec/fixtures/sphinx/people.spi
|
102
|
+
- spec/fixtures/sphinx/people.spk
|
103
|
+
- spec/fixtures/sphinx/people.spm
|
104
|
+
- spec/fixtures/sphinx/people.spp
|
105
|
+
- spec/fixtures/sphinx/searchd.log
|
106
|
+
- spec/fixtures/sphinx/searchd.query.log
|
107
|
+
- spec/fixtures/sphinx/spec.conf
|
108
|
+
- spec/fixtures/sphinxapi.0.9.8.php
|
109
|
+
- spec/fixtures/sphinxapi.0.9.9.php
|
110
|
+
- spec/fixtures/sql/conf.example.yml
|
111
|
+
- spec/fixtures/sql/conf.yml
|
112
|
+
- spec/fixtures/sql/data.sql
|
113
|
+
- spec/fixtures/sql/structure.sql
|
94
114
|
- spec/functional/excerpt_spec.rb
|
95
115
|
- spec/functional/keywords_spec.rb
|
116
|
+
- spec/functional/persistance_spec.rb
|
96
117
|
- spec/functional/search_spec.rb
|
118
|
+
- spec/functional/status_spec.rb
|
97
119
|
- spec/functional/update_spec.rb
|
120
|
+
- spec/spec_helper.rb
|
121
|
+
- spec/sphinx_helper.rb
|
98
122
|
- spec/unit/client_spec.rb
|
99
123
|
- spec/unit/configuration/distributed_index_spec.rb
|
100
124
|
- spec/unit/configuration/index_spec.rb
|
data/MIT-LICENCE
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2007 Pat Allan
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/tabtab_definitions.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
TabTab::Definition.register("searchd") do |c|
|
2
|
-
c.flag :help, :h
|
3
|
-
c.flag :config, :c
|
4
|
-
c.flag :stop
|
5
|
-
c.flag :iostats
|
6
|
-
c.flag :console
|
7
|
-
c.flag :port, :p
|
8
|
-
c.flag :index, :i
|
9
|
-
end
|
10
|
-
|
11
|
-
TabTab::Definition.register("indexer") do |c|
|
12
|
-
c.flag :config, :c
|
13
|
-
c.flag :all
|
14
|
-
c.flag :rotate
|
15
|
-
end
|