Skip to content

Instantly share code, notes, and snippets.

@evanlenz
Created July 20, 2011 21:45
Show Gist options
  • Save evanlenz/1095997 to your computer and use it in GitHub Desktop.
Save evanlenz/1095997 to your computer and use it in GitHub Desktop.
//group[@type eq 'widget']
for $n in (1 to 300) return
xdmp:document-insert(concat("/group",$n,".xml"),
document {
let $pos := ($n mod 3) + 1
let $type := ("widget","person","place")[$pos] return
<group type="{$type}">stuff</group>
}
)
xdmp:query-trace(true()),
//group[@type eq 'widget']
Analyzing path: fn:collection()/descendant::group[@type eq "widget"]
Step 1 is searchable: fn:collection()
Step 2 is searchable: descendant::group[@type eq "widget"]
Path is fully searchable.
Gathering constraints.
Comparison contributed hash value constraint: group/@type = "widget"
Step 2 predicate 1 contributed 1 constraint: @type eq "widget"
Comparison contributed hash value constraint: group/@type = "widget"
Step 2 predicate 1 contributed 1 constraint: @type eq "widget"
Step 2 contributed 2 constraints: descendant::group[@type eq "widget"]
Executing search.
Selected 100 fragments to filter
for $n in (1 to 300) return
xdmp:document-insert(concat("/logfile",$n,".xml"),
document {
let $pos := ($n mod 3) + 1
let $host := concat("host",$pos) return
<logfile host="{$host}"/>
}
)
xdmp:query-trace(true()),
//logfile[@host eq 'host1']
Selected 100 fragments to filter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment