【问题标题】:How to search on the basis of property Type in AEM如何在 AEM 中根据属性类型进行搜索
【发布时间】:2017-02-03 15:23:13
【问题描述】:

我想搜索类型为 String[] 的属性。在我的存储库中,相同的属性同时具有 'String' 和 'String[]' 类型。我只想提取类型为 String[] 的那些。为此,我使用以下查询

path=/content/flip/us/usa/en_us/home/homepage
type=cq:PageContent
1_property=imageRotate
1_property.value=0
1_property.Type=string[]

但我也得到了 String 属性的结果。有什么办法可以做到这一点。

【问题讨论】:

  • IIUC,您需要一种方法来限制对 string[] 类型属性的搜索并排除 string 类型的属性。对吗?
  • 是的……你的理解是正确的

标签: search xpath aem query-builder


【解决方案1】:

当您搜索多值属性时,您需要搜索多个值。由于两者的类型相同,因此仅在具有多值的存储中有所不同。 检索多值属性的示例如下所示

path=/content/geometrixx-outdoors
type=nt:unstructured
property.and=true
property=imageRotate
property.1_value=0
property.2_value=1
property.Type=string[]

XPath 查询:

/jcr:root/content/geometrixx-outdoors//element(*, nt:unstructured)
[
(@imageRotate = '0' and @imageRotate = '1') 
]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-02-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-12
    相关资源
    最近更新 更多