2 # $Id: test3.sh,v 1.1 2004-01-30 13:06:37 heikki Exp $
4 # Testing searches with lots of @and operators
5 # in order to test the fast-forward operation of rsets
11 echo "killing old server (if any)..." >>$LOG
12 test -f zebrasrv.pid && kill `cat zebrasrv.pid`
15 echo "initializing..." >>$LOG
17 ../../index/zebraidx -l $LOG -c zebra1.cfg init || exit 1
19 echo "updating..." >>$LOG
20 ../../index/zebraidx -l $LOG -c zebra1.cfg update records || exit 1
22 echo "starting server..." >>$LOG
23 ../../index/zebrasrv -S -c zebra1.cfg $DBG -l $LOG tcp:@:9901 &
26 echo "checking it runs..." >>$LOG
27 test -f zebrasrv.pid || exit 1
29 echo "search A1..." >>$LOG
30 ../api/testclient localhost:9901 utah > log || exit 1
31 grep "^Result count: 17$" log >/dev/null || exit 1
33 echo "search A2..." >>$LOG
34 ../api/testclient localhost:9901 the > log || exit 1
35 grep "^Result count: 30$" log >/dev/null || exit 1
37 echo "search A3..." >>$LOG
38 ../api/testclient localhost:9901 deposits > log || exit 1
39 grep "^Result count: 4$" log >/dev/null || exit 1
42 echo "search B1..." >>$LOG
43 ../api/testclient localhost:9901 "@and utah the" > log || exit 1
44 grep "^Result count: 7$" log >/dev/null || exit 1
46 echo "search B2..." >>$LOG
47 ../api/testclient localhost:9901 "@and the utah" > log || exit 1
48 grep "^Result count: 7$" log >/dev/null || exit 1
50 echo "search C1..." >>$LOG
51 ../api/testclient localhost:9901 "@and @and the utah epicenter" > log || exit 1
52 grep "^Result count: 1$" log >/dev/null || exit 1
54 echo "search C2..." >>$LOG
55 ../api/testclient localhost:9901 "@and @and the epicenter utah" > log || exit 1
56 grep "^Result count: 1$" log >/dev/null || exit 1
58 echo "search C3..." >>$LOG
59 ../api/testclient localhost:9901 "@and @and utah the epicenter" > log || exit 1
60 grep "^Result count: 1$" log >/dev/null || exit 1
62 echo "search C4..." >>$LOG
63 ../api/testclient localhost:9901 "@and @and utah epicenter the" > log || exit 1
64 grep "^Result count: 1$" log >/dev/null || exit 1
66 echo "search C5..." >>$LOG
67 ../api/testclient localhost:9901 "@and @and epicenter the utah" > log || exit 1
68 grep "^Result count: 1$" log >/dev/null || exit 1
70 echo "search C6..." >>$LOG
71 ../api/testclient localhost:9901 "@and @and epicenter utah the" > log || exit 1
72 grep "^Result count: 1$" log >/dev/null || exit 1
75 echo "search D1..." >>$LOG
76 ../api/testclient localhost:9901 "@and the of " > log || exit 1
77 grep "^Result count: 29$" log >/dev/null || exit 1
79 echo "search D2..." >>$LOG
80 ../api/testclient localhost:9901 "@and of the" > log || exit 1
81 grep "^Result count: 29$" log >/dev/null || exit 1
83 echo "search D3..." >>$LOG
84 ../api/testclient localhost:9901 "@and @and the of of" > log || exit 1
85 grep "^Result count: 29$" log >/dev/null || exit 1
87 echo "search D4..." >>$LOG
88 ../api/testclient localhost:9901 "@and @and of the the" > log || exit 1
89 grep "^Result count: 29$" log >/dev/null || exit 1
91 echo "search D5..." >>$LOG
92 ../api/testclient localhost:9901 "@and @and @and the of of the" > log || exit 1
93 grep "^Result count: 29$" log >/dev/null || exit 1
95 echo "search E1..." >>$LOG
96 ../api/testclient localhost:9901 "@or the utah" > log || exit 1
97 grep "^Result count: 40$" log >/dev/null || exit 1
99 echo "search E2..." >>$LOG
100 ../api/testclient localhost:9901 "@or utah the" > log || exit 1
101 grep "^Result count: 40$" log >/dev/null || exit 1
103 echo "search E3..." >>$LOG
104 ../api/testclient localhost:9901 "@or deposits @or the utah" > log || exit 1
105 grep "^Result count: 42$" log >/dev/null || exit 1
107 echo "search E4..." >>$LOG
108 ../api/testclient localhost:9901 "@and deposits @or the utah" > log || exit 1
109 grep "^Result count: 2$" log >/dev/null || exit 1
111 echo "search E5..." >>$LOG
112 ../api/testclient localhost:9901 "@and @or the utah deposits" > log || exit 1
113 grep "^Result count: 2$" log >/dev/null || exit 1
115 echo "search F1..." >>$LOG
116 ../api/testclient localhost:9901 "@not the utah " > log || exit 1
117 grep "^Result count: 23$" log >/dev/null || exit 1
119 echo "search F2..." >>$LOG
120 ../api/testclient localhost:9901 "@not utah the " > log || exit 1
121 grep "^Result count: 10$" log >/dev/null || exit 1
123 echo "search F3..." >>$LOG
124 ../api/testclient localhost:9901 "@and deposits @not utah the " > log || exit 1
125 grep "^Result count: 1$" log >/dev/null || exit 1
127 echo "search F4..." >>$LOG
128 ../api/testclient localhost:9901 "@and @not utah the deposits" > log || exit 1
129 grep "^Result count: 1$" log >/dev/null || exit 1
132 echo "stopping server..." >>$LOG
133 test -f zebrasrv.pid || exit 1
134 kill `cat zebrasrv.pid` || exit 1
138 echo "Test successfully completed" >>$LOG