From: Adam Dickmeiss Date: Wed, 21 Mar 2007 13:47:12 +0000 (+0000) Subject: For RPN queries the index type (w,p,..) may be specified verbatim X-Git-Tag: ZEBRA.2.0.14~26 X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=commitdiff_plain;h=4dc8f758cd85d2e9925bc5df8a1aa0418b82fea2 For RPN queries the index type (w,p,..) may be specified verbatim as structure attribute with string value, e.g. @attr 4=w . --- diff --git a/NEWS b/NEWS index 8d0404c..35b0fa1 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +For RPN queries the index type (w,p,..) may be specified verbatim +as structure attribute with string value, e.g. @attr 4=w . + Changed record update API . It is now handled by function zebra_record_update which does insert/replace/delete/update of records . This function replaces zebra_record_{insert,delete} and diff --git a/util/zebramap.c b/util/zebramap.c index d227956..0a7cfb9 100644 --- a/util/zebramap.c +++ b/util/zebramap.c @@ -1,4 +1,4 @@ -/* $Id: zebramap.c,v 1.57 2007-03-19 21:50:39 adam Exp $ +/* $Id: zebramap.c,v 1.58 2007-03-21 13:47:12 adam Exp $ Copyright (C) 1995-2007 Index Data ApS @@ -438,6 +438,7 @@ int zebra_maps_attr(ZebraMaps zms, Z_AttributesPlusTerm *zapt, AttrType use; int completeness_value; int structure_value; + const char *structure_str = 0; int relation_value; int sort_relation_value; int weight_value; @@ -451,7 +452,7 @@ int zebra_maps_attr(ZebraMaps zms, Z_AttributesPlusTerm *zapt, attr_init_APT(&use, zapt, 1); completeness_value = attr_find(&completeness, NULL); - structure_value = attr_find(&structure, NULL); + structure_value = attr_find_ex(&structure, NULL, &structure_str); relation_value = attr_find(&relation, NULL); sort_relation_value = attr_find(&sort_relation, NULL); weight_value = attr_find(&weight, NULL); @@ -517,6 +518,12 @@ int zebra_maps_attr(ZebraMaps zms, Z_AttributesPlusTerm *zapt, *reg_id = 'd'; *search_type = "phrase"; break; + case -2: + if (structure_str && *structure_str) + *reg_id = *structure_str; + else + return -1; + break; default: return -1; }