1 /* $Id: index_rules.h,v 1.2 2007-10-23 12:36:22 adam Exp $
2 Copyright (C) 1995-2007
5 This file is part of the Zebra server.
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
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
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
25 \brief Definitions for Zebra's index rules system
28 #ifndef ZEBRA_INDEX_RULES_H
29 #define ZEBRA_INDEX_RULES_H
31 #include <yaz/yconfig.h>
32 #include <yaz/xmltypes.h>
37 \brief zebra index rules handle (ptr)
39 typedef struct zebra_index_rules_s *zebra_index_rules_t;
41 /** \brief creates index rules handler/object from file
43 \returns handle (NULL if unsuccessful)
48 <indexrule id="*:w" position="1" alwaysmatches="1" firstinfield="1"
50 <!-- conversion rules for words -->
52 <indexrule id="*:p" position="0" alwaysmatches="0" firstinfield="0"
54 <!-- conversion rules for phrase -->
56 <indexrule id="*:s" sort="1"
58 <!-- conversion rules for phrase -->
63 zebra_index_rules_t zebra_index_rules_create(const char *fname);
65 /** \brief destroys index rules object
68 void zebra_index_rules_destroy(zebra_index_rules_t r);
71 /** \brief creates index rules handler/object from xml Doc
72 \param doc Libxml2 document
73 \returns handle (NULL if unsuccessful)
75 Similar to zebra_index_rules_create
77 zebra_index_rules_t zebra_index_rules_create_doc(xmlDocPtr doc);
80 /** \brief lookup of indexrule
82 \param id id to search for
85 const char *zebra_index_rule_lookup_str(zebra_index_rules_t r, const char *id);
93 * indent-tabs-mode: nil
95 * vim: shiftwidth=4 tabstop=8 expandtab