Changeset 4d029545b40f84527ced49dc4058d41efd235873
- Timestamp:
- 04/30/08 20:42:59 (8 months ago)
- Parents:
- 76d73d55aa0ba896da711c5ed3d0e2b3e236ef3e
- Children:
- 3021e363641eff71706f13f24f0d3775d2645bfd
- git-committer:
- David Balmain <dbalmain@gmail.com> / 2008-04-30T20:42:59Z+1000
- Location:
- c
- Files:
-
- 9 modified
-
.rake/gcov.history (modified) (previous)
-
Rakefile (modified) (2 diffs)
-
include/index.h (modified) (1 diff)
-
include/internal.h (modified) (1 diff)
-
src/q_phrase.c (modified) (2 diffs)
-
src/q_range.c (modified) (7 diffs)
-
src/term_vectors.c (modified) (3 diffs)
-
test/test_search.c (modified) (19 diffs)
-
test/test_term_vectors.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
c/Rakefile
r2142bb r4d0295 265 265 gcov_sorted_keys.each do |fn| 266 266 res = $gcov_results.files[fn] 267 puts "%2 5s %6.2f%% (%4d)" % [fn, res.percent, res.line_count]268 end 269 puts "Total Lines: %s" % $gcov_results.total_lines270 puts " Total Lines covered: %s (%0.2f%%)" %267 puts "%23s %6.2f%% (%4d)" % [fn, res.percent, res.line_count] 268 end 269 puts "Total Lines: %s" % $gcov_results.total_lines 270 puts "Covered Lines: %s (%0.2f%%)" % 271 271 [$gcov_results.covered_lines, $gcov_results.percent] 272 272 end … … 296 296 297 297 task :do_gcov do 298 CFLAGS << " -fprofile-arcs -ftest-coverage" 298 CFLAGS << " -fprofile-arcs -ftest-coverage -DNDEBUG" 299 FileList['**/*.gcda'].each{|fn| rm fn} 299 300 run_tests 300 301 gcov_result_map = {} -
c/include/index.h
r76d73d r4d0295 560 560 561 561 extern void frt_tv_destroy(FrtTermVector *tv); 562 extern int frt_tv_get_tv_term_index(FrtTermVector *tv, const char *term); 562 extern int frt_tv_get_term_index(FrtTermVector *tv, const char *term); 563 extern int frt_tv_scan_to_term_index(FrtTermVector *tv, const char *term); 563 564 extern FrtTVTerm *frt_tv_get_tv_term(FrtTermVector *tv, const char *term); 564 565 -
c/include/internal.h
r76d73d r4d0295 943 943 #define ts_next frt_ts_next 944 944 #define tv_destroy frt_tv_destroy 945 #define tv_get_term_index frt_tv_get_term_index 945 946 #define tv_get_tv_term frt_tv_get_tv_term 946 #define tv_ get_tv_term_index frt_tv_get_tv_term_index947 #define tv_scan_to_term_index frt_tv_scan_to_term_index 947 948 #define u16 frt_u16 948 949 #define u32 frt_u32 -
c/src/q_phrase.c
r2ac444 r4d0295 462 462 463 463 for (i = 0; i < pp_cnt; i++) { 464 bool res; 464 465 pp = phsc->phrase_pos[i]; 465 466 /* we should always have at least one position or this functions 466 467 * shouldn't have been called. */ 467 assert(pp_first_position(pp)); 468 res = pp_first_position(pp); 469 assert(res);(void)res; 468 470 if (check_repeats && i > 0) { 469 471 if (!sphsc_check_repeats(pp, phsc->phrase_pos, i - 1)) { … … 779 781 TVPosEnum *tvpe = tvpe_new(tv_term->positions, tv_term->freq, 0); 780 782 /* got tv_term so tvpe_next should always return true once here */ 781 assert(tvpe_next(tvpe)); 783 bool res = tvpe_next(tvpe); 784 assert(res);(void)res; 782 785 pq_push(tvpe_pq, tvpe); 783 786 total_positions += tv_term->freq; -
c/src/q_range.c
r0c11a5 r4d0295 409 409 break; 410 410 case TRC_NONE: 411 RAISE(ARG_ERROR, "Nil bounds for range. A range must "412 "include either lower bound or an upper bound");411 /* should never happen. Error should have been raised */ 412 assert(false); 413 413 } 414 414 tde->close(tde); … … 468 468 Range *range = RQ(((ConstantScoreQuery *)self)->original)->range; 469 469 if (tv->field == range->field) { 470 const int term_cnt = tv->term_cnt; 470 471 int i, j; 471 472 char *upper_text = range->upper_term; 472 473 char *lower_text = range->lower_term; 473 474 int upper_limit = range->include_upper ? 1 : 0; 474 int lower_limit = range->include_lower ? 1 : 0; 475 476 for (i = tv->term_cnt - 1; i >= 0; i--) { 475 476 i = lower_text ? tv_scan_to_term_index(tv, lower_text) : 0; 477 if (i < term_cnt && !range->include_lower && lower_text 478 && 0 == strcmp(lower_text, tv->terms[i].text)) { 479 i++; 480 } 481 482 for (; i < term_cnt; i++) { 477 483 TVTerm *tv_term = &(tv->terms[i]); 478 484 char *text = tv_term->text; 479 if ((!upper_text || strcmp(text, upper_text) < upper_limit) &&480 (!lower_text || strcmp(lower_text, text) < lower_limit)) {481 const int tv_term_freq = tv_term->freq;482 for (j = 0; j < tv_term_freq; j++) {483 int pos = tv_term->positions[j];484 matchv_add(mv, pos, pos);485 }485 const int tv_term_freq = tv_term->freq; 486 if (upper_text && strcmp(text, upper_text) >= upper_limit) { 487 break; 488 } 489 for (j = 0; j < tv_term_freq; j++) { 490 int pos = tv_term->positions[j]; 491 matchv_add(mv, pos, pos); 486 492 } 487 493 } … … 528 534 const char *upper_term, bool include_lower, bool include_upper) 529 535 { 530 Query *self = q_new(RangeQuery); 531 532 RQ(self)->range = range_new(field, lower_term, upper_term, 533 include_lower, include_upper); 536 Query *self; 537 Range *range = range_new(field, lower_term, upper_term, 538 include_lower, include_upper); 539 self = q_new(RangeQuery); 540 RQ(self)->range = range; 534 541 535 542 self->type = RANGE_QUERY; … … 553 560 TVTerm *tv_term = &(tv->terms[i]);\ 554 561 char *text = tv_term->text;\ 555 double num = sscanf(text, "%lg%n", &num, &len);\ 556 if ((int)strlen(text) != len) { /* We have a number */\ 562 double num;\ 563 sscanf(text, "%lg%n", &num, &len);\ 564 if ((int)strlen(text) == len) { /* We have a number */\ 557 565 if (cond) {\ 558 566 const int tv_term_freq = tv_term->freq;\ … … 574 582 const char *lt = range->lower_term; 575 583 const char *ut = range->upper_term; 576 if ((!lt || (sscanf(lt,"%lg%n",&lnum,&len) && (int)strlen(lt) == len))&& 577 (!ut || (sscanf(ut,"%lg%n",&unum,&len) && (int)strlen(ut) == len))) 584 if ((!lt 585 || (sscanf(lt,"%lg%n",&lnum,&len) && (int)strlen(lt) == len)) 586 && 587 (!ut 588 || (sscanf(ut,"%lg%n",&unum,&len) && (int)strlen(ut) == len))) 578 589 { 579 590 TypedRangeCheck check = TRC_NONE; … … 615 626 break; 616 627 case TRC_NONE: 617 RAISE(ARG_ERROR, "Nil bounds for range. A range must "618 "include either lower bound or an upper bound");628 /* should never happen. Error should have been raised */ 629 assert(false); 619 630 } 620 631 … … 655 666 const char *upper_term, bool include_lower, bool include_upper) 656 667 { 657 Query *self = q_new(RangeQuery); 658 659 RQ(self)->range = trange_new(field, lower_term, upper_term, 660 include_lower, include_upper); 668 Query *self; 669 Range *range = trange_new(field, lower_term, upper_term, 670 include_lower, include_upper); 671 self = q_new(RangeQuery); 672 RQ(self)->range = range; 661 673 662 674 self->type = TYPED_RANGE_QUERY; -
c/src/term_vectors.c
r76d73d r4d0295 25 25 } 26 26 27 int tv_ get_tv_term_index(TermVector *tv, const char *term)27 int tv_scan_to_term_index(TermVector *tv, const char *term) 28 28 { 29 29 int lo = 0; /* search starts array */ … … 33 33 char *mid_term; 34 34 35 while (hi > lo) {35 while (hi >= lo) { 36 36 mid = (lo + hi) >> 1; 37 37 mid_term = tv->terms[mid].text; … … 47 47 } 48 48 } 49 if (hi >= 0 && strcmp(term, tv->terms[hi].text) == 0) { 50 return hi; 51 } 52 return -1; 49 return lo; 53 50 } 54 51 55 extern TVTerm *tv_get_tv_term(TermVector *tv, const char *term)52 int tv_get_term_index(TermVector *tv, const char *term) 56 53 { 57 int index = tv_get_tv_term_index(tv, term); 54 int index = tv_scan_to_term_index(tv, term); 55 if (index < tv->term_cnt && (0 == strcmp(term, tv->terms[index].text))) { 56 /* found term */ 57 return index; 58 } 59 else { 60 return -1; 61 } 62 } 63 64 TVTerm *tv_get_tv_term(TermVector *tv, const char *term) 65 { 66 int index = tv_get_term_index(tv, term); 58 67 if (index >= 0) { 59 68 return &(tv->terms[index]); -
c/test/test_search.c
r8d8944 r4d0295 7 7 8 8 #define ARRAY_SIZE 40 9 10 static Symbol date, field, cat, number; 9 11 10 12 static void test_byte_float_conversion(TestCase *tc, void *data) … … 85 87 ary_push(positions[3].terms, (char *)"term5"); 86 88 87 Afequal(1.0/4, sim_length_norm(dsim, I("field"), 16));89 Afequal(1.0/4, sim_length_norm(dsim, field, 16)); 88 90 Afequal(1.0/4, sim_query_norm(dsim, 16)); 89 91 Afequal(3.0, sim_tf(dsim, 9)); … … 93 95 searcher.doc_freq = &my_doc_freq; 94 96 searcher.max_doc = &my_max_doc; 95 Afequal(1.0, sim_idf_term(dsim, I("field"), positions[0].terms[0], &searcher));96 Afequal(12.0, sim_idf_phrase(dsim, I("field"), positions, 4, &searcher));97 Afequal(1.0, sim_idf_term(dsim, field, positions[0].terms[0], &searcher)); 98 Afequal(12.0, sim_idf_phrase(dsim, field, positions, 4, &searcher)); 97 99 98 100 ary_free(positions[0].terms); … … 156 158 }; 157 159 158 static Symbol date, field, cat, number;159 160 160 #define SEARCH_DOCS_SIZE 18 161 161 struct Data test_data[SEARCH_DOCS_SIZE] = { … … 163 163 "cat1/", ".123"}, 164 164 {"20051001", "word1 word2 the quick brown fox the quick brown fox", 165 "cat1/sub1", "0. 954"},165 "cat1/sub1", "0.0"}, 166 166 {"20051002", "word1 word3 one two one", 167 167 "cat1/sub1/subsub1", "908.123434"}, … … 201 201 "cat1/", "-1.0"} 202 202 }; 203 203 204 static void prepare_search_index(Store *store) 204 205 { … … 209 210 INDEX_YES, 210 211 TERM_VECTOR_WITH_POSITIONS_OFFSETS); 212 FieldInfo *fi = fi_new(I("empty-field"), STORE_NO, INDEX_NO, TERM_VECTOR_NO); 213 fis_add_field(fis, fi); 211 214 index_create(store, fis); 212 215 fis_deref(fis); … … 333 336 } 334 337 338 void check_match_vector(TestCase *tc, Searcher *searcher, Query *query, 339 int doc, Symbol field, char *ranges) 340 { 341 static int range_array[ARRAY_SIZE]; 342 MatchVector *mv = searcher_get_match_vector(searcher, query, doc, field); 343 int num_matches = s2l(ranges, range_array)/2; 344 if (Aiequal(num_matches, mv->size)) { 345 int i; 346 for (i = 0; i < num_matches; i++) { 347 Aiequal(range_array[i*2 ], mv->matches[i].start); 348 Aiequal(range_array[i*2 + 1], mv->matches[i].end); 349 } 350 } 351 matchv_destroy(mv); 352 } 353 335 354 static void test_term_query(TestCase *tc, void *data) 336 355 { 337 MatchVector *mv;338 356 HashSet *hs; 339 357 Searcher *searcher = (Searcher *)data; … … 392 410 /* test get_matchv_i */ 393 411 check_hits(tc, searcher, tq, "1,11,14,16,17", -1); 394 mv = searcher_get_match_vector(searcher, tq, 1, field); 395 if (Aiequal(2, mv->size)) { 396 Aiequal(3, mv->matches[0].start); 397 Aiequal(3, mv->matches[0].end); 398 Aiequal(7, mv->matches[1].start); 399 Aiequal(7, mv->matches[1].end); 400 } 401 matchv_destroy(mv); 412 check_match_vector(tc, searcher, tq, 1, field, "3,3,7,7"); 402 413 403 414 /* test extract_terms */ … … 555 566 static void test_phrase_query(TestCase *tc, void *data) 556 567 { 557 MatchVector *mv;558 568 Searcher *searcher = (Searcher *)data; 559 569 Explanation *explanation; … … 671 681 phq_add_term(phq, "brown", 1); 672 682 check_hits(tc, searcher, phq, "1", -1); 673 mv = searcher_get_match_vector(searcher, phq, 1, field); 674 if (Aiequal(2, mv->size)) { 675 Aiequal(3, mv->matches[0].start); 676 Aiequal(4, mv->matches[0].end); 677 Aiequal(7, mv->matches[1].start); 678 Aiequal(8, mv->matches[1].end); 679 } 680 matchv_destroy(mv); 683 check_match_vector(tc, searcher, phq, 1, field, "3,4,7,8"); 684 681 685 phq_set_slop(phq, 4); 682 686 check_hits(tc, searcher, phq, "1,16,17", -1); 683 mv = searcher_get_match_vector(searcher, phq, 1, field); 684 if (Aiequal(2, mv->size)) { 685 Aiequal(3, mv->matches[0].start); 686 Aiequal(4, mv->matches[0].end); 687 Aiequal(7, mv->matches[1].start); 688 Aiequal(8, mv->matches[1].end); 689 } 690 matchv_destroy(mv); 691 mv = searcher_get_match_vector(searcher, phq, 16, field); 692 if (Aiequal(1, mv->size)) { 693 Aiequal(2, mv->matches[0].start); 694 Aiequal(5, mv->matches[0].end); 695 } 696 matchv_destroy(mv); 687 check_match_vector(tc, searcher, phq, 16, field, "2,5"); 688 697 689 phq_add_term(phq, "chicken", 1); 698 690 check_hits(tc, searcher, phq, "", -1); 699 mv = searcher_get_match_vector(searcher, phq, 16, field); 700 Aiequal(0, mv->size); 701 matchv_destroy(mv); 691 check_match_vector(tc, searcher, phq, 16, field, ""); 702 692 q_deref(phq); 703 693 } … … 760 750 Searcher *searcher = (Searcher *)data; 761 751 Query *phq, *q; 762 MatchVector *mv;763 752 764 753 phq = phq_new(field); … … 834 823 phq_append_multi_term(phq, "red"); 835 824 check_hits(tc, searcher, phq, "1,11", -1); 836 mv = searcher_get_match_vector(searcher, phq, 1, field); 837 if (Aiequal(2, mv->size)) { 838 Aiequal(3, mv->matches[0].start); 839 Aiequal(4, mv->matches[0].end); 840 Aiequal(7, mv->matches[1].start); 841 Aiequal(8, mv->matches[1].end); 842 } 843 matchv_destroy(mv); 825 check_match_vector(tc, searcher, phq, 1, field, "3,4,7,8"); 826 844 827 phq_set_slop(phq, 1); 845 828 check_hits(tc, searcher, phq, "1,11,17", -1); 846 mv = searcher_get_match_vector(searcher, phq, 1, field); 847 if (Aiequal(2, mv->size)) { 848 Aiequal(3, mv->matches[0].start); 849 Aiequal(4, mv->matches[0].end); 850 Aiequal(7, mv->matches[1].start); 851 Aiequal(8, mv->matches[1].end); 852 } 853 matchv_destroy(mv); 854 mv = searcher_get_match_vector(searcher, phq, 17, field); 855 if (Aiequal(1, mv->size)) { 856 Aiequal(5, mv->matches[0].start); 857 Aiequal(7, mv->matches[0].end); 858 } 859 matchv_destroy(mv); 829 check_match_vector(tc, searcher, phq, 1, field, "3,4,7,8"); 830 check_match_vector(tc, searcher, phq, 17, field, "5,7"); 831 860 832 phq_add_term(phq, "chicken", 1); 861 833 phq_append_multi_term(phq, "turtle"); 862 834 check_hits(tc, searcher, phq, "", -1); 863 mv = searcher_get_match_vector(searcher, phq, 17, field); 864 Aiequal(0, mv->size); 865 matchv_destroy(mv); 835 check_match_vector(tc, searcher, phq, 17, field, ""); 866 836 q_deref(phq); 867 837 } … … 1064 1034 } 1065 1035 1036 static void rq_new_lower_gt_upper(void *p) 1037 { (void)p; rq_new(date, "20050101", "20040101", true, true); } 1038 1039 static void rq_new_include_lower_and_null_lower(void *p) 1040 { (void)p; rq_new(date, NULL, "20040101", true, true); } 1041 1042 static void rq_new_include_upper_and_null_upper(void *p) 1043 { (void)p; rq_new(date, "20050101", NULL, true, true); } 1044 1045 static void rq_new_null_lower_and_upper(void *p) 1046 { (void)p; rq_new(date, NULL, NULL, false, false); } 1047 1066 1048 static void test_range_query(TestCase *tc, void *data) 1067 1049 { 1068 1050 Searcher *searcher = (Searcher *)data; 1069 1051 Query *rq; 1052 1053 Araise(ARG_ERROR, &rq_new_lower_gt_upper, NULL); 1054 Araise(ARG_ERROR, &rq_new_include_lower_and_null_lower, NULL); 1055 Araise(ARG_ERROR, &rq_new_include_upper_and_null_upper, NULL); 1056 Araise(ARG_ERROR, &rq_new_null_lower_and_upper, NULL); 1057 1070 1058 rq = rq_new(date, "20051006", "20051010", true, true); 1071 1059 check_hits(tc, searcher, rq, "6,7,8,9,10", -1); … … 1129 1117 check_hits(tc, searcher, rq, "", -1); 1130 1118 q_deref(rq); 1119 1120 /* test get_matchv_i */ 1121 /* NOTE: if you are reading this to learn how to use RangeQuery the 1122 * following is not a good idea. You should usually only use a RangeQuery 1123 * on an untokenized field. This is just done for testing purposes to 1124 * check that it works correctly. */ 1125 rq = rq_new(field, "word1", "word3", true, true); 1126 check_hits(tc, searcher, rq, "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17", -1); 1127 check_match_vector(tc, searcher, rq, 2, I("not a field"), ""); 1128 check_match_vector(tc, searcher, rq, 2, field, "0,0,1,1"); 1129 q_deref(rq); 1130 1131 rq = rq_new(field, "word1", "word3", false, true); 1132 check_match_vector(tc, searcher, rq, 2, field, "1,1"); 1133 q_deref(rq); 1134 1135 rq = rq_new(field, "word1", "word3", true, false); 1136 check_match_vector(tc, searcher, rq, 2, field, "0,0"); 1137 q_deref(rq); 1138 1139 rq = rq_new(field, "word1", "word3", false, false); 1140 check_match_vector(tc, searcher, rq, 2, field, ""); 1141 q_deref(rq); 1131 1142 } 1132 1143 … … 1194 1205 } 1195 1206 1207 static void trq_new_int_lower_gt_upper(void *p) 1208 { (void)p; trq_new(date, "20050101", "20040101", true, true); } 1209 1210 static void trq_new_float_lower_gt_upper(void *p) 1211 { (void)p; trq_new(number, "2.5", "-2.5", true, true); } 1212 1213 static void trq_new_string_lower_gt_upper(void *p) 1214 { (void)p; trq_new(cat, "cat_b", "cat_a", true, true); } 1215 1216 static void trq_new_include_lower_and_null_lower(void *p) 1217 { (void)p; trq_new(date, NULL, "20040101", true, true); } 1218 1219 static void trq_new_include_upper_and_null_upper(void *p) 1220 { (void)p; trq_new(date, "20050101", NULL, true, true); } 1221 1222 static void trq_new_null_lower_and_upper(void *p) 1223 { (void)p; trq_new(date, NULL, NULL, false, false); } 1224 1196 1225 static void test_typed_range_query(TestCase *tc, void *data) 1197 1226 { 1198 1227 Searcher *searcher = (Searcher *)data; 1199 1228 Query *trq; 1229 1230 Araise(ARG_ERROR, trq_new_int_lower_gt_upper, NULL); 1231 Araise(ARG_ERROR, trq_new_float_lower_gt_upper, NULL); 1232 Araise(ARG_ERROR, trq_new_string_lower_gt_upper, NULL); 1233 Araise(ARG_ERROR, trq_new_include_lower_and_null_lower, NULL); 1234 Araise(ARG_ERROR, trq_new_include_upper_and_null_upper, NULL); 1235 Araise(ARG_ERROR, trq_new_null_lower_and_upper, NULL); 1236 1200 1237 trq = trq_new(number, "-1.0", "1.0", true, true); 1201 1238 check_hits(tc, searcher, trq, "0,1,4,10,15,17", -1); 1239 check_match_vector(tc, searcher, trq, 0, number, "0,0"); 1240 check_match_vector(tc, searcher, trq, 10, number, "0,0"); 1241 check_match_vector(tc, searcher, trq, 17, number, "0,0"); 1242 check_match_vector(tc, searcher, trq, 2, number, ""); 1202 1243 q_deref(trq); 1203 1244 1204 1245 trq = trq_new(number, "-1.0", "1.0", false, false); 1205 1246 check_hits(tc, searcher, trq, "0,1,4,15", -1); 1206 q_deref(trq); 1207 1247 check_match_vector(tc, searcher, trq, 0, number, "0,0"); 1248 check_match_vector(tc, searcher, trq, 10, number, ""); 1249 check_match_vector(tc, searcher, trq, 17, number, ""); 1250 q_deref(trq); 1251 1252 trq = trq_new(number, "-1.0", "1.0", false, true); 1253 check_hits(tc, searcher, trq, "0,1,4,10,15", -1); 1254 check_match_vector(tc, searcher, trq, 0, number, "0,0"); 1255 check_match_vector(tc, searcher, trq, 10, number, "0,0"); 1256 check_match_vector(tc, searcher, trq, 17, number, ""); 1257 q_deref(trq); 1258 1259 trq = trq_new(number, "-1.0", "1.0", true, false); 1260 check_hits(tc, searcher, trq, "0,1,4,15,17", -1); 1261 check_match_vector(tc, searcher, trq, 0, number, "0,0"); 1262 check_match_vector(tc, searcher, trq, 10, number, ""); 1263 check_match_vector(tc, searcher, trq, 17, number, "0,0"); 1264 q_deref(trq); 1265 1266 /* test field with no numbers */ 1267 trq = trq_new(field, "-1.0", "1.0", false, true); 1268 check_hits(tc, searcher, trq, "", -1); 1269 check_match_vector(tc, searcher, trq, 0, number, ""); 1270 q_deref(trq); 1271 1272 /* test empty field */ 1273 trq = trq_new(I("empty-field"), "-1.0", "1.0", false, true); 1274 check_hits(tc, searcher, trq, "", -1); 1275 check_match_vector(tc, searcher, trq, 0, number, ""); 1276 q_deref(trq); 1277 1278 /* FIXME: This was a hexidecimal test but unfortunately scanf doesn't do 1279 * hexidecimal on some machines. Would be nice to test for this in 1280 * ./configure when we eventually integrate autotools */ 1208 1281 /* text hexadecimal */ 1209 1282 trq = trq_new(number, "1.0", "10", false, true); … … 1213 1286 /* test single bound */ 1214 1287 trq = trq_new(number, NULL, "0", false, true); 1288 check_hits(tc, searcher, trq, "1,5,11,15,16,17", -1); 1289 check_match_vector(tc, searcher, trq, 1, number, "0.0"); 1290 check_match_vector(tc, searcher, trq, 5, number, "0,0"); 1291 q_deref(trq); 1292 1293 trq = trq_new_less(number, "0", true); 1294 check_hits(tc, searcher, trq, "1,5,11,15,16,17", -1); 1295 check_match_vector(tc, searcher, trq, 1, number, "0.0"); 1296 check_match_vector(tc, searcher, trq, 5, number, "0,0"); 1297 q_deref(trq); 1298 1299 trq = trq_new(number, NULL, "0", false, false); 1215 1300 check_hits(tc, searcher, trq, "5,11,15,16,17", -1); 1301 check_match_vector(tc, searcher, trq, 1, number, ""); 1302 check_match_vector(tc, searcher, trq, 5, number, "0,0"); 1303 q_deref(trq); 1304 1305 trq = trq_new_less(number, "0", false); 1306 check_hits(tc, searcher, trq, "5,11,15,16,17", -1); 1307 check_match_vector(tc, searcher, trq, 1, number, ""); 1308 check_match_vector(tc, searcher, trq, 5, number, "0,0"); 1216 1309 q_deref(trq); 1217 1310 1218 1311 /* test single bound */ 1312 trq = trq_new(number, "0", NULL, true, false); 1313 check_hits(tc, searcher, trq, "0,1,2,3,4,6,7,8,9,10,12,13,14", -1); 1314 check_match_vector(tc, searcher, trq, 1, number, "0.0"); 1315 check_match_vector(tc, searcher, trq, 0, number, "0,0"); 1316 q_deref(trq); 1317 1318 trq = trq_new_more(number, "0", true); 1319 check_hits(tc, searcher, trq, "0,1,2,3,4,6,7,8,9,10,12,13,14", -1); 1320 check_match_vector(tc, searcher, trq, 1, number, "0.0"); 1321 check_match_vector(tc, searcher, trq, 0, number, "0,0"); 1322 q_deref(trq); 1323 1219 1324 trq = trq_new(number, "0", NULL, false, false); 1220 check_hits(tc, searcher, trq, "0,1,2,3,4,6,7,8,9,10,12,13,14", -1); 1325 check_hits(tc, searcher, trq, "0,2,3,4,6,7,8,9,10,12,13,14", -1); 1326 check_match_vector(tc, searcher, trq, 1, number, ""); 1327 check_match_vector(tc, searcher, trq, 0, number, "0,0"); 1328 q_deref(trq); 1329 1330 trq = trq_new_more(number, "0", false); 1331 check_hits(tc, searcher, trq, "0,2,3,4,6,7,8,9,10,12,13,14", -1); 1332 check_match_vector(tc, searcher, trq, 1, number, ""); 1333 check_match_vector(tc, searcher, trq, 0, number, "0,0"); 1221 1334 q_deref(trq); 1222 1335 … …
