projects
/
irspy-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8798262
)
Multiple attributes generated by single CQL index.
author
Mike Taylor
<mike@indexdata.com>
Tue, 20 Jun 2006 11:24:22 +0000
(11:24 +0000)
committer
Mike Taylor
<mike@indexdata.com>
Tue, 20 Jun 2006 11:24:22 +0000
(11:24 +0000)
zebra/ezeerex2pqfproperties.pl
patch
|
blob
|
history
diff --git
a/zebra/ezeerex2pqfproperties.pl
b/zebra/ezeerex2pqfproperties.pl
index
33cb0c0
..
2201b83
100755
(executable)
--- a/
zebra/ezeerex2pqfproperties.pl
+++ b/
zebra/ezeerex2pqfproperties.pl
@@
-1,6
+1,6
@@
#! /usr/bin/perl -w
#! /usr/bin/perl -w
-# $Id: ezeerex2pqfproperties.pl,v 1.6 2006-06-20 11:05:43 mike Exp $
+# $Id: ezeerex2pqfproperties.pl,v 1.7 2006-06-20 11:24:22 mike Exp $
#
# Run like this:
# ./ezeerex2pqfproperties.pl zeerex.xml
#
# Run like this:
# ./ezeerex2pqfproperties.pl zeerex.xml
@@
-67,20
+67,23
@@
sub print_indexes {
foreach my $node ($xc->findnodes('z:indexInfo/' .
'z:index[@search="true"]')) {
foreach my $node ($xc->findnodes('z:indexInfo/' .
'z:index[@search="true"]')) {
- my @pqf = $xc->findnodes("z:map/z:attr", $node);
+ my @pqf = $xc->findnodes("z:map[z:attr]", $node);
die("no PQF mapping for index '" .
$xc->findvalue("z:title", $node) . "'")
if @pqf == 0;
die("no PQF mapping for index '" .
$xc->findvalue("z:title", $node) . "'")
if @pqf == 0;
- my $ptype = $xc->findvalue('@type', $pqf[0]);
- my $pval = $xc->findvalue(".", $pqf[0]);
+ # Just pick one if there's more than one: they all work
+
+ my $attrstr = "";
+ foreach my $attr ($xc->findnodes("z:attr", $pqf[0])) {
+ my $ptype = $xc->findvalue('@type', $attr);
+ my $pval = $xc->findvalue(".", $attr);
+ $attrstr .= " $ptype=$pval";
+ }
foreach my $map ($xc->findnodes("z:map", $node)) {
my $setname = $xc->findvalue('z:name/@set', $map);
my $indexname = $xc->findvalue('z:name', $map);
foreach my $map ($xc->findnodes("z:map", $node)) {
my $setname = $xc->findvalue('z:name/@set', $map);
my $indexname = $xc->findvalue('z:name', $map);
- ### We need a way for the ZeeRex record to specify other
- # attributes to be specified along with the access-point,
- # e.g. @attr 4=3 for whole-field indexes.
- print "index.$setname.$indexname = $ptype=$pval\n"
+ print "index.$setname.$indexname =$attrstr\n"
if $indexname ne "";
}
}
if $indexname ne "";
}
}