有没有办法为 cts:field-values
传递 computed-buckets ?
我创建了一个字段范围索引.. 我无法使用 search:search
动态构建我的 cts:query
..
我想为我的 cts:query
计算桶的频率...
如果我使用 search:search
<range type="xs:dateTime" facet="true">
<computed-bucket lt="P0Y" ge="-P1Y" anchor="start-of-year" name="lastyear">Last Year</computed-bucket>
<computed-bucket lt="-P1Y" ge="-P100Y" anchor="start-of-year" name="older">Older</computed-bucket>
<computed-bucket lt="P1M" ge="P0M" anchor="start-of-month" name="thismonth">This Month</computed-bucket>
<computed-bucket lt="P1Y" ge="P0Y" anchor="start-of-year" name="thisyear">This Year</computed-bucket>
<facet-option>frequency-order</facet-option>
<facet-option>descending</facet-option>
<facet-option>limit=10</facet-option>
<field name="upload_date"/>
</range>
最佳答案
不幸的是,您不能在搜索选项中使用带有 values
和 tuples
的桶(例如与 search:values
一起使用),但如注释,您至少可以使用 search:resolve
生成一个 cts:query
。一旦你有了 cts:query
,你就可以手动构建你需要的桶,可能使用 cts:value-ranges .
有时创建一个动态计算分面桶的自定义分面也是值得的。例如我刚才放在一起的动态桶约束:
https://github.com/grtjn/ml-constraints#dynamic-buckets-constraint
喂!
关于marklogic - 使用 cts :field-values 计算的存储桶,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37661520/