ferret 0.10.1 → 0.10.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/Rakefile +7 -1
- data/ext/analysis.c +21 -13
- data/ext/array.c +1 -1
- data/ext/bitvector.c +2 -2
- data/ext/defines.h +0 -6
- data/ext/except.c +6 -6
- data/ext/except.h +12 -8
- data/ext/extconf.rb +1 -0
- data/ext/ferret.c +4 -0
- data/ext/ferret.h +1 -0
- data/ext/fs_store.c +18 -4
- data/ext/global.c +18 -16
- data/ext/global.h +7 -2
- data/ext/hash.c +1 -1
- data/ext/helper.c +1 -1
- data/ext/helper.h +1 -1
- data/ext/inc/lang.h +7 -1
- data/ext/ind.c +4 -4
- data/ext/ind.h +3 -3
- data/ext/index.c +33 -26
- data/ext/index.h +1 -1
- data/ext/lang.h +7 -1
- data/ext/mem_pool.c +1 -1
- data/ext/mem_pool.h +1 -1
- data/ext/q_fuzzy.c +2 -2
- data/ext/q_match_all.c +2 -2
- data/ext/q_multi_term.c +1 -1
- data/ext/q_parser.c +60 -52
- data/ext/r_analysis.c +6 -4
- data/ext/r_index.c +57 -4
- data/ext/r_search.c +1 -1
- data/ext/r_utils.c +1 -1
- data/ext/ram_store.c +1 -1
- data/ext/search.c +4 -4
- data/ext/sort.c +3 -3
- data/ext/store.c +9 -9
- data/ext/store.h +4 -4
- data/ext/tags +7841 -0
- data/ext/term_vectors.c +3 -3
- data/lib/ferret/index.rb +69 -7
- data/test/test_helper.rb +3 -2
- data/test/unit/analysis/tc_token_stream.rb +1 -0
- data/test/unit/index/tc_index.rb +157 -2
- data/test/unit/index/tc_index_reader.rb +108 -5
- data/test/unit/query_parser/tc_query_parser.rb +2 -1
- data/test/unit/search/tc_index_searcher.rb +1 -1
- data/test/unit/search/tc_multi_searcher.rb +2 -1
- data/test/unit/search/tc_spans.rb +1 -1
- data/test/unit/store/tc_fs_store.rb +6 -3
- data/test/unit/ts_analysis.rb +1 -1
- data/test/unit/ts_utils.rb +1 -1
- data/test/unit/utils/tc_number_tools.rb +1 -1
- metadata +138 -137
@@ -94,7 +94,8 @@ class QueryParserTest < Test::Unit::TestCase
|
|
94
94
|
['*:(xxx AND bbb)', '+(xxx field:xxx f1:xxx f2:xxx) +(bbb field:bbb f1:bbb f2:bbb)'],
|
95
95
|
['f1|f2:(xxx AND bbb)', '+(f1:xxx f2:xxx) +(f1:bbb f2:bbb)'],
|
96
96
|
['asdf?*?asd*dsf?asfd*asdf?^20.0', 'asdf?*?asd*dsf?asfd*asdf?^20.0'],
|
97
|
-
['"onewordphrase"', 'onewordphrase']
|
97
|
+
['"onewordphrase"', 'onewordphrase'],
|
98
|
+
["who'd", "who'd"]
|
98
99
|
]
|
99
100
|
|
100
101
|
pairs.each do |query_str, expected|
|
@@ -45,7 +45,7 @@ class SearcherTest < Test::Unit::TestCase
|
|
45
45
|
top_docs.hits.each do |score_doc|
|
46
46
|
assert(expected.include?(score_doc.doc),
|
47
47
|
"#{score_doc.doc} was found unexpectedly")
|
48
|
-
assert(score_doc.score
|
48
|
+
assert(score_doc.score.approx_eql?(@searcher.explain(query, score_doc.doc).score),
|
49
49
|
"Scores(#{score_doc.score} != #{@searcher.explain(query, score_doc.doc).score})")
|
50
50
|
end
|
51
51
|
end
|
@@ -110,7 +110,8 @@ class MultiSearcherTest < Test::Unit::TestCase
|
|
110
110
|
|
111
111
|
multi_docs.hits.each_with_index { |sd, id|
|
112
112
|
assert_equal(single_docs.hits[id].doc, sd.doc)
|
113
|
-
|
113
|
+
assert(single_docs.hits[id].score.approx_eql?(sd.score),
|
114
|
+
"#{single_docs.hits[id]} != #{sd.score}")
|
114
115
|
}
|
115
116
|
end
|
116
117
|
|
@@ -76,7 +76,7 @@ class SpansBasicTest < Test::Unit::TestCase
|
|
76
76
|
assert(expected.include?(hit.doc),
|
77
77
|
"#{hit.doc} was found unexpectedly")
|
78
78
|
if test_explain
|
79
|
-
assert(hit.score
|
79
|
+
assert(hit.score.approx_eql?(@searcher.explain(query, hit.doc).score),
|
80
80
|
"Scores(#{hit.score} != " +
|
81
81
|
"#{@searcher.explain(query, hit.doc).score})")
|
82
82
|
end
|
@@ -31,8 +31,7 @@ class FSStoreTest < Test::Unit::TestCase
|
|
31
31
|
|
32
32
|
assert(File.exists?(lock_file_path), "A lock file should have been created")
|
33
33
|
|
34
|
-
assert(
|
35
|
-
"The lock should be hidden by the FSDirectories directory scan")
|
34
|
+
assert(@dir.exists?(lfname(lock_name)),"The lock should exist")
|
36
35
|
|
37
36
|
lock.release
|
38
37
|
|
@@ -65,10 +64,14 @@ class FSStoreTest < Test::Unit::TestCase
|
|
65
64
|
# end
|
66
65
|
#
|
67
66
|
def make_lock_file_path(name)
|
68
|
-
lock_file_path = File.join(@dpath,
|
67
|
+
lock_file_path = File.join(@dpath, lfname(name))
|
69
68
|
if File.exists?(lock_file_path) then
|
70
69
|
File.delete(lock_file_path)
|
71
70
|
end
|
72
71
|
return lock_file_path
|
73
72
|
end
|
73
|
+
|
74
|
+
def lfname(name)
|
75
|
+
"ferret-#{name}.lck"
|
76
|
+
end
|
74
77
|
end
|
data/test/unit/ts_analysis.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), "../test_helper.rb")
|
2
|
-
load_test_dir('unit/
|
2
|
+
load_test_dir('unit/analysis')
|
data/test/unit/ts_utils.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), "../test_helper.rb")
|
2
|
-
load_test_dir('unit/
|
2
|
+
load_test_dir('unit/utils')
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: ferret
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.10.
|
7
|
-
date: 2006-
|
6
|
+
version: 0.10.2
|
7
|
+
date: 2006-09-03 00:00:00 +09:00
|
8
8
|
summary: Ruby indexing library.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -29,177 +29,178 @@ authors:
|
|
29
29
|
- David Balmain
|
30
30
|
files:
|
31
31
|
- setup.rb
|
32
|
-
- TODO
|
33
32
|
- Rakefile
|
33
|
+
- TODO
|
34
|
+
- README
|
34
35
|
- MIT-LICENSE
|
35
36
|
- TUTORIAL
|
36
|
-
-
|
37
|
-
- ext/
|
38
|
-
- ext/
|
39
|
-
- ext/
|
40
|
-
- ext/
|
41
|
-
- ext/
|
42
|
-
- ext/stem_ISO_8859_1_danish.c
|
43
|
-
- ext/stem_UTF_8_portuguese.h
|
44
|
-
- ext/similarity.h
|
45
|
-
- ext/r_search.c
|
46
|
-
- ext/hashset.h
|
47
|
-
- ext/extconf.rb
|
48
|
-
- ext/analysis.h
|
49
|
-
- ext/index.h
|
50
|
-
- ext/stem_UTF_8_russian.h
|
51
|
-
- ext/q_match_all.c
|
52
|
-
- ext/libstemmer.h
|
53
|
-
- ext/stem_UTF_8_finnish.h
|
54
|
-
- ext/stem_ISO_8859_1_german.c
|
37
|
+
- ext/q_filtered_query.c
|
38
|
+
- ext/priorityqueue.c
|
39
|
+
- ext/hashset.c
|
40
|
+
- ext/helper.c
|
41
|
+
- ext/global.c
|
42
|
+
- ext/bitvector.c
|
55
43
|
- ext/hash.c
|
56
|
-
- ext/
|
57
|
-
- ext/
|
44
|
+
- ext/fs_store.c
|
45
|
+
- ext/posh.c
|
46
|
+
- ext/except.c
|
47
|
+
- ext/ram_store.c
|
58
48
|
- ext/store.c
|
59
|
-
- ext/
|
60
|
-
- ext/
|
61
|
-
- ext/similarity.c
|
62
|
-
- ext/r_analysis.c
|
63
|
-
- ext/stem_UTF_8_portuguese.c
|
64
|
-
- ext/stem_ISO_8859_1_norwegian.h
|
65
|
-
- ext/helper.c
|
66
|
-
- ext/stem_UTF_8_french.h
|
67
|
-
- ext/q_span.c
|
68
|
-
- ext/utilities.c
|
69
|
-
- ext/stem_ISO_8859_1_porter.h
|
70
|
-
- ext/ind.c
|
71
|
-
- ext/global.h
|
72
|
-
- ext/except.h
|
49
|
+
- ext/analysis.c
|
50
|
+
- ext/document.c
|
73
51
|
- ext/search.c
|
74
|
-
- ext/
|
75
|
-
- ext/
|
76
|
-
- ext/
|
77
|
-
- ext/
|
52
|
+
- ext/similarity.c
|
53
|
+
- ext/stopwords.c
|
54
|
+
- ext/array.c
|
55
|
+
- ext/index.c
|
56
|
+
- ext/mem_pool.c
|
78
57
|
- ext/compound_io.c
|
79
|
-
- ext/
|
80
|
-
- ext/
|
81
|
-
- ext/
|
82
|
-
- ext/
|
83
|
-
- ext/defines.h
|
84
|
-
- ext/stem_ISO_8859_1_dutch.h
|
85
|
-
- ext/stem_ISO_8859_1_swedish.h
|
58
|
+
- ext/q_prefix.c
|
59
|
+
- ext/q_range.c
|
60
|
+
- ext/q_phrase.c
|
61
|
+
- ext/q_term.c
|
86
62
|
- ext/sort.c
|
87
|
-
- ext/
|
88
|
-
- ext/
|
89
|
-
- ext/stem_UTF_8_porter.c
|
63
|
+
- ext/q_boolean.c
|
64
|
+
- ext/filter.c
|
90
65
|
- ext/q_const_score.c
|
91
|
-
- ext/
|
92
|
-
- ext/
|
66
|
+
- ext/q_match_all.c
|
67
|
+
- ext/q_wildcard.c
|
93
68
|
- ext/q_fuzzy.c
|
69
|
+
- ext/q_multi_term.c
|
70
|
+
- ext/q_parser.c
|
71
|
+
- ext/q_span.c
|
72
|
+
- ext/ind.c
|
73
|
+
- ext/term_vectors.c
|
74
|
+
- ext/priorityqueue.h
|
75
|
+
- ext/defines.h
|
94
76
|
- ext/posh.h
|
95
|
-
- ext/
|
96
|
-
- ext/
|
77
|
+
- ext/store.h
|
78
|
+
- ext/hashset.h
|
79
|
+
- ext/helper.h
|
80
|
+
- ext/global.h
|
81
|
+
- ext/bitvector.h
|
82
|
+
- ext/document.h
|
97
83
|
- ext/hash.h
|
84
|
+
- ext/except.h
|
85
|
+
- ext/threading.h
|
86
|
+
- ext/similarity.h
|
87
|
+
- ext/index.h
|
88
|
+
- ext/win32.h
|
89
|
+
- ext/analysis.h
|
98
90
|
- ext/search.h
|
99
|
-
- ext/
|
100
|
-
- ext/
|
101
|
-
- ext/except.c
|
91
|
+
- ext/mem_pool.h
|
92
|
+
- ext/array.h
|
102
93
|
- ext/ind.h
|
103
|
-
- ext/
|
104
|
-
- ext/
|
105
|
-
- ext/
|
106
|
-
- ext/
|
94
|
+
- ext/lang.h
|
95
|
+
- ext/stem_UTF_8_norwegian.c
|
96
|
+
- ext/stem_UTF_8_danish.c
|
97
|
+
- ext/stem_UTF_8_dutch.c
|
98
|
+
- ext/stem_UTF_8_english.c
|
99
|
+
- ext/stem_UTF_8_finnish.c
|
100
|
+
- ext/stem_UTF_8_french.c
|
101
|
+
- ext/stem_UTF_8_german.c
|
102
|
+
- ext/stem_UTF_8_italian.c
|
103
|
+
- ext/stem_UTF_8_portuguese.c
|
104
|
+
- ext/stem_UTF_8_porter.c
|
105
|
+
- ext/stem_KOI8_R_russian.c
|
106
|
+
- ext/stem_UTF_8_russian.c
|
107
|
+
- ext/stem_UTF_8_spanish.c
|
107
108
|
- ext/stem_UTF_8_swedish.c
|
108
|
-
- ext/q_boolean.c
|
109
|
-
- ext/api.h
|
110
|
-
- ext/ram_store.c
|
111
|
-
- ext/stem_UTF_8_porter.h
|
112
|
-
- ext/inc
|
113
|
-
- ext/stem_ISO_8859_1_spanish.h
|
114
|
-
- ext/stem_UTF_8_danish.h
|
115
|
-
- ext/index.c
|
116
109
|
- ext/stem_ISO_8859_1_english.c
|
117
|
-
- ext/
|
118
|
-
- ext/stopwords.c
|
119
|
-
- ext/r_qparser.c
|
120
|
-
- ext/store.h
|
121
|
-
- ext/analysis.c
|
110
|
+
- ext/stem_ISO_8859_1_danish.c
|
122
111
|
- ext/stem_ISO_8859_1_dutch.c
|
123
|
-
- ext/stem_ISO_8859_1_finnish.
|
124
|
-
- ext/
|
125
|
-
- ext/
|
126
|
-
- ext/stem_UTF_8_russian.c
|
127
|
-
- ext/stem_UTF_8_norwegian.h
|
128
|
-
- ext/api.c
|
129
|
-
- ext/array.c
|
112
|
+
- ext/stem_ISO_8859_1_finnish.c
|
113
|
+
- ext/stem_ISO_8859_1_french.c
|
114
|
+
- ext/stem_ISO_8859_1_german.c
|
130
115
|
- ext/stem_ISO_8859_1_italian.c
|
116
|
+
- ext/stem_ISO_8859_1_norwegian.c
|
117
|
+
- ext/stem_ISO_8859_1_porter.c
|
118
|
+
- ext/stem_ISO_8859_1_portuguese.c
|
131
119
|
- ext/stem_ISO_8859_1_spanish.c
|
132
|
-
- ext/
|
133
|
-
- ext/
|
134
|
-
- ext/
|
135
|
-
- ext/
|
136
|
-
- ext/
|
137
|
-
- ext/
|
120
|
+
- ext/stem_ISO_8859_1_swedish.c
|
121
|
+
- ext/stem_UTF_8_danish.h
|
122
|
+
- ext/stem_UTF_8_dutch.h
|
123
|
+
- ext/stem_UTF_8_english.h
|
124
|
+
- ext/stem_UTF_8_finnish.h
|
125
|
+
- ext/stem_UTF_8_french.h
|
126
|
+
- ext/stem_UTF_8_german.h
|
127
|
+
- ext/stem_UTF_8_italian.h
|
128
|
+
- ext/stem_UTF_8_norwegian.h
|
129
|
+
- ext/stem_UTF_8_porter.h
|
130
|
+
- ext/stem_UTF_8_portuguese.h
|
131
|
+
- ext/stem_UTF_8_russian.h
|
132
|
+
- ext/stem_UTF_8_spanish.h
|
133
|
+
- ext/stem_UTF_8_swedish.h
|
134
|
+
- ext/stem_KOI8_R_russian.h
|
135
|
+
- ext/stem_ISO_8859_1_danish.h
|
136
|
+
- ext/stem_ISO_8859_1_dutch.h
|
137
|
+
- ext/stem_ISO_8859_1_english.h
|
138
|
+
- ext/stem_ISO_8859_1_finnish.h
|
138
139
|
- ext/stem_ISO_8859_1_french.h
|
139
|
-
- ext/
|
140
|
+
- ext/stem_ISO_8859_1_german.h
|
140
141
|
- ext/stem_ISO_8859_1_italian.h
|
141
|
-
- ext/
|
142
|
-
- ext/
|
143
|
-
- ext/
|
144
|
-
- ext/
|
145
|
-
- ext/
|
146
|
-
- ext/
|
147
|
-
- ext/
|
148
|
-
- ext/
|
149
|
-
- ext/stem_UTF_8_english.h
|
150
|
-
- ext/stem_ISO_8859_1_finnish.c
|
151
|
-
- ext/stem_UTF_8_french.c
|
152
|
-
- ext/mem_pool.h
|
153
|
-
- ext/posh.c
|
154
|
-
- ext/fs_store.c
|
155
|
-
- ext/mem_pool.c
|
156
|
-
- ext/priorityqueue.h
|
142
|
+
- ext/stem_ISO_8859_1_norwegian.h
|
143
|
+
- ext/stem_ISO_8859_1_porter.h
|
144
|
+
- ext/stem_ISO_8859_1_portuguese.h
|
145
|
+
- ext/stem_ISO_8859_1_spanish.h
|
146
|
+
- ext/stem_ISO_8859_1_swedish.h
|
147
|
+
- ext/utilities.c
|
148
|
+
- ext/api.c
|
149
|
+
- ext/api.h
|
157
150
|
- ext/header.h
|
158
|
-
- ext/bitvector.c
|
159
|
-
- ext/r_index.c
|
160
151
|
- ext/libstemmer.c
|
161
|
-
- ext/
|
162
|
-
- ext/
|
163
|
-
- ext/
|
164
|
-
- ext/inc
|
152
|
+
- ext/modules.h
|
153
|
+
- ext/libstemmer.h
|
154
|
+
- ext/extconf.rb
|
155
|
+
- ext/inc
|
156
|
+
- ext/ferret.h
|
157
|
+
- ext/ferret.c
|
158
|
+
- ext/tags
|
159
|
+
- ext/r_analysis.c
|
160
|
+
- ext/r_utils.c
|
161
|
+
- ext/r_store.c
|
162
|
+
- ext/r_index.c
|
163
|
+
- ext/r_search.c
|
164
|
+
- ext/r_qparser.c
|
165
165
|
- ext/inc/threading.h
|
166
|
-
-
|
166
|
+
- ext/inc/lang.h
|
167
167
|
- lib/ferret.rb
|
168
|
+
- lib/ferret_version.rb
|
168
169
|
- lib/ferret/number_tools.rb
|
169
170
|
- lib/ferret/index.rb
|
170
171
|
- lib/ferret/document.rb
|
171
|
-
- test/test_helper.rb
|
172
172
|
- test/test_all.rb
|
173
|
-
- test/
|
173
|
+
- test/test_helper.rb
|
174
174
|
- test/unit/ts_analysis.rb
|
175
|
-
- test/unit/
|
176
|
-
- test/unit/tc_document.rb
|
177
|
-
- test/unit/ts_search.rb
|
175
|
+
- test/unit/ts_store.rb
|
178
176
|
- test/unit/ts_utils.rb
|
177
|
+
- test/unit/tc_document.rb
|
179
178
|
- test/unit/ts_index.rb
|
180
|
-
- test/unit/
|
181
|
-
- test/unit/
|
179
|
+
- test/unit/ts_search.rb
|
180
|
+
- test/unit/ts_query_parser.rb
|
181
|
+
- test/unit/utils/tc_bit_vector.rb
|
182
|
+
- test/unit/utils/tc_priority_queue.rb
|
183
|
+
- test/unit/utils/tc_number_tools.rb
|
184
|
+
- test/unit/analysis/tc_analyzer.rb
|
185
|
+
- test/unit/analysis/tc_token_stream.rb
|
182
186
|
- test/unit/store/tm_store_lock.rb
|
187
|
+
- test/unit/store/tc_fs_store.rb
|
183
188
|
- test/unit/store/tc_ram_store.rb
|
189
|
+
- test/unit/store/tm_store.rb
|
190
|
+
- test/unit/index/tc_index_reader.rb
|
191
|
+
- test/unit/index/tc_index_writer.rb
|
192
|
+
- test/unit/index/tc_index.rb
|
193
|
+
- test/unit/index/th_doc.rb
|
184
194
|
- test/unit/search/tc_index_searcher.rb
|
185
|
-
- test/unit/search/tc_fuzzy_query.rb
|
186
195
|
- test/unit/search/tc_multi_searcher.rb
|
187
|
-
- test/unit/search/
|
188
|
-
- test/unit/search/tm_searcher.rb
|
189
|
-
- test/unit/search/tc_spans.rb
|
190
|
-
- test/unit/search/tc_filter.rb
|
196
|
+
- test/unit/search/tc_fuzzy_query.rb
|
191
197
|
- test/unit/search/tc_sort.rb
|
198
|
+
- test/unit/search/tc_filter.rb
|
199
|
+
- test/unit/search/tc_spans.rb
|
192
200
|
- test/unit/search/tc_sort_field.rb
|
193
|
-
- test/unit/
|
194
|
-
- test/unit/
|
195
|
-
- test/unit/index/tc_index_writer.rb
|
196
|
-
- test/unit/index/tc_index_reader.rb
|
197
|
-
- test/unit/analysis/tc_token_stream.rb
|
198
|
-
- test/unit/analysis/tc_analyzer.rb
|
201
|
+
- test/unit/search/tc_search_and_sort.rb
|
202
|
+
- test/unit/search/tm_searcher.rb
|
199
203
|
- test/unit/query_parser/tc_query_parser.rb
|
200
|
-
- test/unit/utils/tc_priority_queue.rb
|
201
|
-
- test/unit/utils/tc_bit_vector.rb
|
202
|
-
- test/unit/utils/tc_number_tools.rb
|
203
204
|
test_files: []
|
204
205
|
|
205
206
|
rdoc_options:
|
@@ -215,12 +216,12 @@ extra_rdoc_files:
|
|
215
216
|
- TODO
|
216
217
|
- TUTORIAL
|
217
218
|
- MIT-LICENSE
|
218
|
-
- ext/r_search.c
|
219
219
|
- ext/r_analysis.c
|
220
|
-
- ext/r_qparser.c
|
221
|
-
- ext/r_store.c
|
222
220
|
- ext/r_utils.c
|
221
|
+
- ext/r_store.c
|
223
222
|
- ext/r_index.c
|
223
|
+
- ext/r_search.c
|
224
|
+
- ext/r_qparser.c
|
224
225
|
- ext/ferret.c
|
225
226
|
executables: []
|
226
227
|
|