|
561 | 561 | dimension and value, pass a key "facets" in the options map given in the third
|
562 | 562 | parameter of <literal>ft:query</literal>:</para>
|
563 | 563 | <programlisting language="xquery" xlink:href="listings/listing-57.txt"/>
|
564 |
| - <para>If you specify more than one value for one facet dimension, these will be linked |
565 |
| - together with a logical <literal>or</literal>, thus returning elements matching any |
566 |
| - of the alternative facet values for that dimension. If you specify multiple |
567 |
| - dimensions, they are treated as an <literal>and</literal>, limiting the result to |
568 |
| - elements matching both dimensions.</para> |
| 564 | + <para>If you specify multiple dimensions, these will be linked together with a logical |
| 565 | + <literal>and</literal>, limiting the result to elements matching both dimensions.</para> |
| 566 | + <para>Treatment of multiple values for one facet dimension depends on the type of facet. |
| 567 | + For non-hierarchical facets, as in example above, if you specify more than one value these |
| 568 | + will be linked together with a logical <literal>or</literal>, |
| 569 | + returning elements matching any of the alternative facet values for that dimension.</para> |
| 570 | + <para>In case of hierarchical facets, a sequence of items is |
| 571 | + interpreted as a hierarchical value/subvalue facet path, therefore expression like |
| 572 | + <code>("2018", "06", "25")</code> for the <emphasis>date</emphasis> dimension mentioned |
| 573 | + earlier will return nodes from the 25th of June 2018. Nested sequences |
| 574 | + are not allowed in XQuery, so the only way to pass in multiple hierarchical facet paths |
| 575 | + is by wrapping the whole structure in an array. Each array element then is logically |
| 576 | + linked with its other members with <literal>or</literal> expression. To query |
| 577 | + for elements from June <emphasis>or</emphasis> May 2018 we therefore need to specify |
| 578 | + date dimension values as <code>[("2018", "06"), ("2018", "05")]</code> |
| 579 | + </para> |
| 580 | + <programlisting language="xquery" xlink:href="listings/listing-571.txt"/> |
569 | 581 | </sect2>
|
570 | 582 | <sect2 xml:id="describe">
|
571 | 583 | <title>Describing Queries in XML</title>
|
|
0 commit comments