kpumuk-rlibsphinxclient 0.2.0

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.
Files changed (77) hide show
  1. data/CHANGELOG +0 -0
  2. data/Manifest +75 -0
  3. data/README.rdoc +149 -0
  4. data/Rakefile +33 -0
  5. data/ext/extconf.rb +20 -0
  6. data/ext/rlibsphinxclient.i +314 -0
  7. data/ext/rlibsphinxclient_wrap.c +5931 -0
  8. data/init.rb +1 -0
  9. data/lib/sphinx/client.rb +1070 -0
  10. data/lib/sphinx/fast_client.rb +184 -0
  11. data/lib/sphinx/request.rb +49 -0
  12. data/lib/sphinx/response.rb +69 -0
  13. data/lib/sphinx/safe_executor.rb +11 -0
  14. data/lib/sphinx/timeout.rb +9 -0
  15. data/lib/sphinx.rb +22 -0
  16. data/rlibsphinxclient.gemspec +35 -0
  17. data/spec/client_response_spec.rb +135 -0
  18. data/spec/client_spec.rb +548 -0
  19. data/spec/fixtures/default_search.php +8 -0
  20. data/spec/fixtures/default_search_index.php +8 -0
  21. data/spec/fixtures/excerpt_custom.php +11 -0
  22. data/spec/fixtures/excerpt_default.php +8 -0
  23. data/spec/fixtures/excerpt_flags.php +11 -0
  24. data/spec/fixtures/field_weights.php +9 -0
  25. data/spec/fixtures/filter.php +9 -0
  26. data/spec/fixtures/filter_exclude.php +9 -0
  27. data/spec/fixtures/filter_float_range.php +9 -0
  28. data/spec/fixtures/filter_float_range_exclude.php +9 -0
  29. data/spec/fixtures/filter_range.php +9 -0
  30. data/spec/fixtures/filter_range_exclude.php +9 -0
  31. data/spec/fixtures/filter_ranges.php +10 -0
  32. data/spec/fixtures/filters.php +10 -0
  33. data/spec/fixtures/filters_different.php +13 -0
  34. data/spec/fixtures/geo_anchor.php +9 -0
  35. data/spec/fixtures/group_by_attr.php +9 -0
  36. data/spec/fixtures/group_by_attrpair.php +9 -0
  37. data/spec/fixtures/group_by_day.php +9 -0
  38. data/spec/fixtures/group_by_day_sort.php +9 -0
  39. data/spec/fixtures/group_by_month.php +9 -0
  40. data/spec/fixtures/group_by_week.php +9 -0
  41. data/spec/fixtures/group_by_year.php +9 -0
  42. data/spec/fixtures/group_distinct.php +10 -0
  43. data/spec/fixtures/id_range.php +9 -0
  44. data/spec/fixtures/id_range64.php +9 -0
  45. data/spec/fixtures/index_weights.php +9 -0
  46. data/spec/fixtures/keywords.php +8 -0
  47. data/spec/fixtures/limits.php +9 -0
  48. data/spec/fixtures/limits_cutoff.php +9 -0
  49. data/spec/fixtures/limits_max.php +9 -0
  50. data/spec/fixtures/limits_max_cutoff.php +9 -0
  51. data/spec/fixtures/match_all.php +9 -0
  52. data/spec/fixtures/match_any.php +9 -0
  53. data/spec/fixtures/match_boolean.php +9 -0
  54. data/spec/fixtures/match_extended.php +9 -0
  55. data/spec/fixtures/match_extended2.php +9 -0
  56. data/spec/fixtures/match_fullscan.php +9 -0
  57. data/spec/fixtures/match_phrase.php +9 -0
  58. data/spec/fixtures/max_query_time.php +9 -0
  59. data/spec/fixtures/miltiple_queries.php +12 -0
  60. data/spec/fixtures/ranking_bm25.php +9 -0
  61. data/spec/fixtures/ranking_none.php +9 -0
  62. data/spec/fixtures/ranking_proximity_bm25.php +9 -0
  63. data/spec/fixtures/ranking_wordcount.php +9 -0
  64. data/spec/fixtures/retries.php +9 -0
  65. data/spec/fixtures/retries_delay.php +9 -0
  66. data/spec/fixtures/sort_attr_asc.php +9 -0
  67. data/spec/fixtures/sort_attr_desc.php +9 -0
  68. data/spec/fixtures/sort_expr.php +9 -0
  69. data/spec/fixtures/sort_extended.php +9 -0
  70. data/spec/fixtures/sort_relevance.php +9 -0
  71. data/spec/fixtures/sort_time_segments.php +9 -0
  72. data/spec/fixtures/sphinxapi.php +1181 -0
  73. data/spec/fixtures/update_attributes.php +8 -0
  74. data/spec/fixtures/weights.php +9 -0
  75. data/spec/sphinx/sphinx.conf +67 -0
  76. data/spec/sphinx/sphinx_test.sql +86 -0
  77. metadata +153 -0
@@ -0,0 +1,8 @@
1
+ <?php
2
+
3
+ require ("sphinxapi.php");
4
+
5
+ $cl = new SphinxClient();
6
+ $cl->UpdateAttributes('index', array('group'), array(123 => array(456)));
7
+
8
+ ?>
@@ -0,0 +1,9 @@
1
+ <?php
2
+
3
+ require ("sphinxapi.php");
4
+
5
+ $cl = new SphinxClient();
6
+ $cl->SetWeights(array(10, 20, 30, 40));
7
+ $cl->Query('query');
8
+
9
+ ?>
@@ -0,0 +1,67 @@
1
+ source src1
2
+ {
3
+ type = mysql
4
+ sql_host = localhost
5
+ sql_user = root
6
+ sql_pass =
7
+ sql_db = sphinx_test
8
+ sql_port = 3306 # optional, default is 3306
9
+
10
+ sql_query = SELECT id, name, description, UNIX_TIMESTAMP(created_at) AS created_at, group_id, rating FROM links
11
+ sql_attr_uint = group_id
12
+ sql_attr_timestamp = created_at
13
+ sql_attr_float = rating
14
+ sql_attr_multi = uint tags from query; SELECT link_id, tag_id FROM links_tags
15
+ sql_query_info = SELECT * FROM links WHERE id=$id
16
+ }
17
+
18
+ source src2
19
+ {
20
+ type = mysql
21
+ sql_host = localhost
22
+ sql_user = root
23
+ sql_pass =
24
+ sql_db = sphinx_test
25
+ sql_port = 3306 # optional, default is 3306
26
+
27
+ sql_query = SELECT id, name, description, UNIX_TIMESTAMP(created_at) AS created_at, group_id FROM links64
28
+ sql_attr_uint = group_id
29
+ sql_attr_timestamp = created_at
30
+ sql_query_info = SELECT * FROM links WHERE id=$id
31
+ }
32
+
33
+ index test1
34
+ {
35
+ source = src1
36
+ path = /opt/sphinx-0.9.9/var/data/test1
37
+ docinfo = extern
38
+ morphology = none
39
+ stopwords =
40
+ charset_type = utf-8
41
+ }
42
+
43
+ index test2
44
+ {
45
+ source = src2
46
+ path = /opt/sphinx-0.9.9/var/data/test2
47
+ docinfo = extern
48
+ morphology = none
49
+ stopwords =
50
+ charset_type = utf-8
51
+ }
52
+
53
+ indexer
54
+ {
55
+ mem_limit = 32M
56
+ }
57
+
58
+ searchd
59
+ {
60
+ port = 3312
61
+ log = /opt/sphinx-0.9.9/var/log/searchd.log
62
+ query_log = /opt/sphinx-0.9.9/var/log/query.log
63
+ read_timeout = 5
64
+ max_children = 30
65
+ pid_file = /opt/sphinx-0.9.9/var/log/searchd.pid
66
+ max_matches = 1000
67
+ }
@@ -0,0 +1,86 @@
1
+ /*
2
+ SQLyog Enterprise - MySQL GUI v5.20
3
+ Host - 5.0.27-community-nt : Database - sphinx_test
4
+ *********************************************************************
5
+ Server version : 5.0.27-community-nt
6
+ */
7
+
8
+ SET NAMES utf8;
9
+
10
+ SET SQL_MODE='';
11
+
12
+ CREATE database IF NOT EXISTS `sphinx_test`;
13
+
14
+ USE `sphinx_test`;
15
+
16
+ /* Table structure for table `links` */
17
+
18
+ DROP TABLE IF EXISTS `links`;
19
+
20
+ CREATE TABLE `links` (
21
+ `id` INT(11) NOT NULL auto_increment,
22
+ `name` VARCHAR(255) NOT NULL,
23
+ `created_at` DATETIME NOT NULL,
24
+ `description` TEXT,
25
+ `group_id` INT(11) NOT NULL,
26
+ `rating` FLOAT NOT NULL,
27
+ PRIMARY KEY (`id`)
28
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
29
+
30
+ /* Table structure for table `tags` */
31
+
32
+ DROP TABLE IF EXISTS `tags`;
33
+
34
+ CREATE TABLE `tags` (
35
+ `id` INT(11) NOT NULL auto_increment,
36
+ `tag` VARCHAR(255) NOT NULL,
37
+ PRIMARY KEY (`id`)
38
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
39
+
40
+ /* Table structure for table `links_tags` */
41
+
42
+ DROP TABLE IF EXISTS `links_tags`;
43
+
44
+ CREATE TABLE `links_tags` (
45
+ `link_id` INT(11) NOT NULL,
46
+ `tag_id` INT(11) NOT NULL,
47
+ PRIMARY KEY (`link_id`,`tag_id`)
48
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
49
+
50
+ /* Table structure for table `links64` */
51
+
52
+ DROP TABLE IF EXISTS `links64`;
53
+
54
+ CREATE TABLE `links64` (
55
+ `id` BIGINT(11) NOT NULL auto_increment,
56
+ `name` VARCHAR(255) NOT NULL,
57
+ `created_at` DATETIME NOT NULL,
58
+ `description` TEXT,
59
+ `group_id` INT(11) NOT NULL,
60
+ PRIMARY KEY (`id`)
61
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
62
+
63
+ /* Data for the table `links` */
64
+
65
+ INSERT INTO `links`(`id`,`name`,`created_at`,`description`,`group_id`,`rating`) VALUES
66
+ (1,'Paint Protects WiFi Network from Hackers','2007-04-04 06:48:10','A company known as SEC Technologies has created a special type of paint that blocks Wi-Fi signals so that you can be sure hackers can ',1,13.32),
67
+ (2,'Airplanes To Become WiFi Hotspots','2007-04-04 06:49:15','Airlines will start turning their airplanes into WiFi hotspots beginning early next year, WSJ reports. Here\'s what you need to know...',2,54.85),
68
+ (3,'Planet VIP-195 GSM/WiFi Phone With Windows Messanger','2007-04-04 06:50:47','The phone does comply with IEEE 802.11b and IEEE 802.11g to provide phone capability via WiFi. As GSM phone the VIP-195 support 900/1800/1900 band and GPRS too. It comes with simple button to switch between WiFi or GSM mod',1,16.25);
69
+
70
+ /* Data for the table `tags` */
71
+ INSERT INTO `tags`(`id`,`tag`) VALUES
72
+ (1, 'tag1'),(2, 'tag2'),(3, 'tag3'),(4, 'tag4'),(5, 'tag5'),
73
+ (6, 'tag6'),(7, 'tag7'),(8, 'tag8'),(9, 'tag9'),(10, 'tag5');
74
+
75
+ /* Data for the table `links_tags` */
76
+ INSERT INTO `links_tags`(`link_id`,`tag_id`) VALUES
77
+ (1, 1),(1, 2),(1, 3),(1, 4),
78
+ (2, 5),(2, 6),(2, 7),(2, 8),
79
+ (3, 9),(3, 1),(3, 7),(3, 10);
80
+
81
+ /* Data for the table `links64` */
82
+
83
+ INSERT INTO `links64`(`id`,`name`,`created_at`,`description`,`group_id`) VALUES
84
+ (4294967297,'Paint Protects WiFi Network from Hackers','2007-04-04 06:48:10','A company known as SEC Technologies has created a special type of paint that blocks Wi-Fi signals so that you can be sure hackers can ',1),
85
+ (4294967298,'Airplanes To Become WiFi Hotspots','2007-04-04 06:49:15','Airlines will start turning their airplanes into WiFi hotspots beginning early next year, WSJ reports. Here\'s what you need to know...',2),
86
+ (4294967299,'Planet VIP-195 GSM/WiFi Phone With Windows Messanger','2007-04-04 06:50:47','The phone does comply with IEEE 802.11b and IEEE 802.11g to provide phone capability via WiFi. As GSM phone the VIP-195 support 900/1800/1900 band and GPRS too. It comes with simple button to switch between WiFi or GSM mod',1);
metadata ADDED
@@ -0,0 +1,153 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kpumuk-rlibsphinxclient
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Dmytro Shteflyuk
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-01-27 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: echoe
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0"
23
+ version:
24
+ description: A Ruby wrapper for pure C searchd client API library
25
+ email: kpumuk@kpumuk.info
26
+ executables: []
27
+
28
+ extensions:
29
+ - ext/extconf.rb
30
+ extra_rdoc_files:
31
+ - CHANGELOG
32
+ - ext/extconf.rb
33
+ - ext/rlibsphinxclient.i
34
+ - ext/rlibsphinxclient_wrap.c
35
+ - lib/sphinx/client.rb
36
+ - lib/sphinx/fast_client.rb
37
+ - lib/sphinx/request.rb
38
+ - lib/sphinx/response.rb
39
+ - lib/sphinx/safe_executor.rb
40
+ - lib/sphinx/timeout.rb
41
+ - lib/sphinx.rb
42
+ - README.rdoc
43
+ files:
44
+ - CHANGELOG
45
+ - ext/extconf.rb
46
+ - ext/rlibsphinxclient.i
47
+ - ext/rlibsphinxclient_wrap.c
48
+ - init.rb
49
+ - lib/sphinx/client.rb
50
+ - lib/sphinx/fast_client.rb
51
+ - lib/sphinx/request.rb
52
+ - lib/sphinx/response.rb
53
+ - lib/sphinx/safe_executor.rb
54
+ - lib/sphinx/timeout.rb
55
+ - lib/sphinx.rb
56
+ - Manifest
57
+ - Rakefile
58
+ - README.rdoc
59
+ - spec/client_response_spec.rb
60
+ - spec/client_spec.rb
61
+ - spec/fixtures/default_search.php
62
+ - spec/fixtures/default_search_index.php
63
+ - spec/fixtures/excerpt_custom.php
64
+ - spec/fixtures/excerpt_default.php
65
+ - spec/fixtures/excerpt_flags.php
66
+ - spec/fixtures/field_weights.php
67
+ - spec/fixtures/filter.php
68
+ - spec/fixtures/filter_exclude.php
69
+ - spec/fixtures/filter_float_range.php
70
+ - spec/fixtures/filter_float_range_exclude.php
71
+ - spec/fixtures/filter_range.php
72
+ - spec/fixtures/filter_range_exclude.php
73
+ - spec/fixtures/filter_ranges.php
74
+ - spec/fixtures/filters.php
75
+ - spec/fixtures/filters_different.php
76
+ - spec/fixtures/geo_anchor.php
77
+ - spec/fixtures/group_by_attr.php
78
+ - spec/fixtures/group_by_attrpair.php
79
+ - spec/fixtures/group_by_day.php
80
+ - spec/fixtures/group_by_day_sort.php
81
+ - spec/fixtures/group_by_month.php
82
+ - spec/fixtures/group_by_week.php
83
+ - spec/fixtures/group_by_year.php
84
+ - spec/fixtures/group_distinct.php
85
+ - spec/fixtures/id_range.php
86
+ - spec/fixtures/id_range64.php
87
+ - spec/fixtures/index_weights.php
88
+ - spec/fixtures/keywords.php
89
+ - spec/fixtures/limits.php
90
+ - spec/fixtures/limits_cutoff.php
91
+ - spec/fixtures/limits_max.php
92
+ - spec/fixtures/limits_max_cutoff.php
93
+ - spec/fixtures/match_all.php
94
+ - spec/fixtures/match_any.php
95
+ - spec/fixtures/match_boolean.php
96
+ - spec/fixtures/match_extended.php
97
+ - spec/fixtures/match_extended2.php
98
+ - spec/fixtures/match_fullscan.php
99
+ - spec/fixtures/match_phrase.php
100
+ - spec/fixtures/max_query_time.php
101
+ - spec/fixtures/miltiple_queries.php
102
+ - spec/fixtures/ranking_bm25.php
103
+ - spec/fixtures/ranking_none.php
104
+ - spec/fixtures/ranking_proximity_bm25.php
105
+ - spec/fixtures/ranking_wordcount.php
106
+ - spec/fixtures/retries.php
107
+ - spec/fixtures/retries_delay.php
108
+ - spec/fixtures/sort_attr_asc.php
109
+ - spec/fixtures/sort_attr_desc.php
110
+ - spec/fixtures/sort_expr.php
111
+ - spec/fixtures/sort_extended.php
112
+ - spec/fixtures/sort_relevance.php
113
+ - spec/fixtures/sort_time_segments.php
114
+ - spec/fixtures/sphinxapi.php
115
+ - spec/fixtures/update_attributes.php
116
+ - spec/fixtures/weights.php
117
+ - spec/sphinx/sphinx.conf
118
+ - spec/sphinx/sphinx_test.sql
119
+ - rlibsphinxclient.gemspec
120
+ has_rdoc: true
121
+ homepage: http://github.com/kpumuk/rlibsphinxclient
122
+ post_install_message:
123
+ rdoc_options:
124
+ - --line-numbers
125
+ - --inline-source
126
+ - --title
127
+ - Rlibsphinxclient
128
+ - --main
129
+ - README.rdoc
130
+ require_paths:
131
+ - lib
132
+ - ext
133
+ required_ruby_version: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: "0"
138
+ version:
139
+ required_rubygems_version: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ version: "1.2"
144
+ version:
145
+ requirements: []
146
+
147
+ rubyforge_project: rlibsphinxclient
148
+ rubygems_version: 1.2.0
149
+ signing_key:
150
+ specification_version: 2
151
+ summary: A Ruby wrapper for pure C searchd client API library
152
+ test_files: []
153
+