8cba20a41d6764501a7c0a46e28b62a2f946cd0a
[idzebra-moved-to-github.git] / test / api / t9.c
1 /* $Id: t9.c,v 1.12 2006-09-08 14:40:57 adam Exp $
2    Copyright (C) 1995-2006
3    Index Data ApS
4
5 This file is part of the Zebra server.
6
7 Zebra is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
21 */
22
23 /** t9.c - test rank-1 */
24
25 #include "testlib.h"
26
27 #include "rankingrecords.h"
28
29 static void tst(int argc, char **argv)
30 {
31     ZebraService zs = tl_start_up(0, argc, argv);
32     ZebraHandle zh = zebra_open(zs, 0);
33
34     YAZ_CHECK(tl_init_data(zh, recs));
35     
36     YAZ_CHECK(tl_ranking_query(zh, "@attr 1=4 @attr 2=102 the",
37                                3, "first title", 936 ));
38     
39     YAZ_CHECK(tl_ranking_query(zh, "@attr 1=62 @attr 2=102 foo",
40                                3, "second title", 850 ));
41     
42     YAZ_CHECK(tl_close_down(zh, zs));
43 }
44
45 TL_MAIN
46 /*
47  * Local variables:
48  * c-basic-offset: 4
49  * indent-tabs-mode: nil
50  * End:
51  * vim: shiftwidth=4 tabstop=8 expandtab
52  */
53