You can also query dimension value paths using the numerical ID of a dimension value, rather than its name.
In this case, the query returns records that are
tagged with this dimension value and all of its descendants (if any). This
syntax does not use the "dimensions" argument to the
collection()
function, but it does use the
endeca:dval-by-id()
helper function, as follows:
collection()/record[dimName = endeca:dval-by-id(dimValId)//id]
where:
dimName
is the NCName of the dimension from which the dimension values are filtered. The dimension name is not quoted and is case sensitive.dimValId
is the ID of the dimension value on the records that you want returned.dimValId
can be any dimension value in the dimension and is not quoted.//id
is the path terminator that specifies that the path be extended to any descendants ofdimValId
.
You can also use the
and
or
or
operators, as shown in the second example below. You
can also use one of the negation operators described in the "Negation
operators" topic.
The first query example selects records that are tagged with either the dimension value whose ID is 9 or its descendants.
collection()/record [ Genre = endeca:dval-by-id(9)//id ]
The next query example uses an
or
operator to select records that are tagged with
either dimension value 8 (or its descendants) or dimension value 11 (or its
descendants).
collection()/record [ Genre = endeca:dval-by-id(8)//id or Genre = endeca:dval-by-id(11)//id ]