-/* $Id: recgrs.c,v 1.20 2007-10-29 09:25:40 adam Exp $
- Copyright (C) 1995-2007
- Index Data ApS
-
-This file is part of the Zebra server.
+/* This file is part of the Zebra server.
+ Copyright (C) 1994-2011 Index Data
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
- wrd->term_buf += start;
- wrd->term_len -= start;
- if (wrd->term_len > len)
- wrd->term_len = len;
+ if (start >= wrd->term_len)
+ wrd->term_len = 0;
+ else
+ {
+ wrd->term_len -= start;
+ wrd->term_buf += start;
+
+ if (wrd->term_len > len)
+ wrd->term_len = len;
+ }
wrd->term_buf = tag_path;
wrd->term_len = strlen(tag_path);
(*p->tokenAdd)(wrd);
if (value) {
wrd->index_name = ZEBRA_XPATH_ATTR_CDATA;
wrd->term_buf = tag_path;
wrd->term_len = strlen(tag_path);
(*p->tokenAdd)(wrd);
if (value) {
wrd->index_name = ZEBRA_XPATH_ATTR_CDATA;
memcpy(&wrd_tl, wrd, sizeof(*wrd));
if (tl->source)
sp_parse(sp, n, &wrd_tl, tl->source);
memcpy(&wrd_tl, wrd, sizeof(*wrd));
if (tl->source)
sp_parse(sp, n, &wrd_tl, tl->source);
wrd->term_buf = tag_path_full;
wrd->term_len = strlen(tag_path_full);
wrd->index_name = xpath_index;
wrd->term_buf = tag_path_full;
wrd->term_len = strlen(tag_path_full);
wrd->index_name = xpath_index;
wrd->index_name = ZEBRA_XPATH_ATTR_NAME;
wrd->term_buf = xp->name;
wrd->term_len = strlen(xp->name);
wrd->index_name = ZEBRA_XPATH_ATTR_NAME;
wrd->term_buf = xp->name;
wrd->term_len = strlen(xp->name);
struct recExtractCtrl *p, int level, RecWord *wrd)
{
data1_termlist *tlist = 0;
struct recExtractCtrl *p, int level, RecWord *wrd)
{
data1_termlist *tlist = 0;
/*
* cycle up towards the root until we find a tag with an att..
* this has the effect of indexing locally defined tags with
/*
* cycle up towards the root until we find a tag with an att..
* this has the effect of indexing locally defined tags with
yaz_log(YLOG_DEBUG, "grs_retrieve: schema mapping");
for (map = node->u.root.absyn->maptabs; map; map = map->next)
{
yaz_log(YLOG_DEBUG, "grs_retrieve: schema mapping");
for (map = node->u.root.absyn->maptabs; map; map = map->next)
{