Permalink
Browse files

distinct values na consulta das keys dos indices

  • Loading branch information...
1 parent e95ff6a commit c6a09c722edd015d05cc66ba4e2fdacca5a81902 Roneltton Lafitte committed May 17, 2011
Showing with 8 additions and 4 deletions.
  1. +8 −4 Acao/lib/Acao/Model/Volume.pm
@@ -528,11 +528,15 @@ sub find_key_indexes {
$clause = substr $clause, 0, $length-4;
$self->sedna->commit;
- my $xq_indexes = qq|declare namespace cl = "http://schemas.fortaleza.ce.gov.br/acao/classificacao.xsd";
+ #my $xq_indexes = qq|declare namespace cl = "http://schemas.fortaleza.ce.gov.br/acao/classificacao.xsd";
+ # declare namespace idx = "http://schemas.fortaleza.ce.gov.br/acao/indexhint.xsd";
+ # for \$x in collection("acao-schemas")/*/*/*/*/cl:classificacoes
+ # where $clause
+ # return \$x/../../../../*/*/*/idx:index/idx:hint/\@key/string()|;
+ my $xq_indexes = 'declare namespace cl = "http://schemas.fortaleza.ce.gov.br/acao/classificacao.xsd";
declare namespace idx = "http://schemas.fortaleza.ce.gov.br/acao/indexhint.xsd";
- for \$x in collection("acao-schemas")/*/*/*/*/cl:classificacoes
- where $clause
- return \$x/../../../../*/*/*/idx:index/idx:hint/\@key/string()|;
+ for $x in distinct-values(collection("acao-schemas")//@key/string())
+ return $x';
$self->sedna->begin;
$self->sedna->execute($xq_indexes);

0 comments on commit c6a09c7

Please sign in to comment.