1 /* $Id: index_rules.h,v 1.1 2007-10-23 12:26:25 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
24 \brief Definitions for Zebra's index rules system
27 #ifndef ZEBRA_INDEX_RULES_H
28 #define ZEBRA_INDEX_RULES_H
30 #include <yaz/yconfig.h>
31 #include <yaz/xmltypes.h>
35 typedef struct zebra_index_rules_s *zebra_index_rules_t;
37 /** \brief creates index rules handler/object from file
39 \returns handle (NULL if unsuccessful)
44 <indexrule id="*:w" position="1" alwaysmatches="1" firstinfield="1"
46 <!-- conversion rules for words -->
48 <indexrule id="*:p" position="0" alwaysmatches="0" firstinfield="0"
50 <!-- conversion rules for phrase -->
52 <indexrule id="*:s" sort="1"
54 <!-- conversion rules for phrase -->
59 zebra_index_rules_t zebra_index_rules_create(const char *fname);
61 /** \brief destroys index rules object
64 void zebra_index_rules_destroy(zebra_index_rules_t r);
67 /** \brief creates index rules handler/object from xml Doc
69 \returns handle (NULL if unsuccessful)
71 Similar to zebra_index_rules_create
73 zebra_index_rules_t zebra_index_rules_create_doc(xmlDocPtr doc);
76 /** \brief lookup of indexrule
78 \param id id to search for
81 const char *zebra_index_rule_lookup_str(zebra_index_rules_t r, const char *id);
89 * indent-tabs-mode: nil
91 * vim: shiftwidth=4 tabstop=8 expandtab