0

我想使用 querybuilder 在我的 DAM 文件夹中搜索文件。在我的测试文件夹中,我有 1 个 .pptx 文件(powerpoint)和 1 个 .png 文件(图像)。

但是当我运行以下查询时,我得到 3 个结果:

1. <PPTX file>/jcr:content
2. <PPTX file>.jcr:content/subassets/slide1/jcr:content
3 <image file>/jcr:content

查询是:

path=/content/dam/my-folder
type=dam:AssetContent
p.limit=-1

是否有任何其他谓词可将其限制为 2 个结果(仅限文件)?

我试过"type=dam:Asset"了,但它给出了 0 个结果。并"type=nt:base"给出 20 个结果

4

2 回答 2

4

您正在寻找的是谓词mainasset。当您mainasset=true在查询中指定时,它将忽略结果中的子资产。因此,您只需搜索类型dam:Asset并指定mainasset谓词,如下所示。

path=/content/dam/my-folder
type=dam:Asset
mainasset=true
p.limit=-1

有关 AEM 中可用谓词列表的更多信息,请参阅本用户指南

于 2018-10-02T11:52:18.563 回答
0

低于 AEM 6.3 -

使用path.flat谓词将搜索范围缩小到仅直接子代而不是subtree.

path=/content/dam/we-retail/en/mahna
path.flat=true 
type=dam:AssetContent

您还可以使用nodename谓词查询具有特定文件扩展名的节点名称

path=/content/dam/we-retail/en/mahna
type=dam:Asset
group.1_nodename=*.pptx
group.2_nodename=*.JPG
group.p.or=true
于 2018-10-02T05:14:08.897 回答