AEM 查询生成器:需要在所有页面的所有属性上搜索特定文本
AEM Query Builder: Need to search for specific text on all properties on all pages
我需要搜索包含一段特定文本的所有节点。我知道我可以为此使用 LIKE 操作,但问题是当您未指定任何属性时如何搜索字符串?基本上,如果任何页面上任何节点上的任何 属性 包含该字符串,我想要 return 那些结果?
有人可以帮忙吗?
G
我想你可以尝试 'fulltext' 搜索,
path=/content
fulltext=searchtext
您可以使用它来使用 AEM 查询生成器在任何路径下的任何属性内搜索任何子字符串。您可以使用 asterisk 或 * 如果您不需要子字符串而只需要全文,请删除“*”并提供搜索文本;
path=/content
fulltext=*anyTextToSearch*
或在 XPATH 查询中
/jcr:root/content/path/to/page//*[jcr:contains(., '(*anyTextToSearch*')]
或在 SQL2 中
SELECT * FROM [nt:unstructured] AS node
WHERE ISDESCENDANTNODE(node, "/search/in/path")
AND CONTAINS([propertyName], "*anyTextToSearch*")
我需要搜索包含一段特定文本的所有节点。我知道我可以为此使用 LIKE 操作,但问题是当您未指定任何属性时如何搜索字符串?基本上,如果任何页面上任何节点上的任何 属性 包含该字符串,我想要 return 那些结果?
有人可以帮忙吗?
G
我想你可以尝试 'fulltext' 搜索,
path=/content
fulltext=searchtext
您可以使用它来使用 AEM 查询生成器在任何路径下的任何属性内搜索任何子字符串。您可以使用 asterisk 或 * 如果您不需要子字符串而只需要全文,请删除“*”并提供搜索文本;
path=/content
fulltext=*anyTextToSearch*
或在 XPATH 查询中
/jcr:root/content/path/to/page//*[jcr:contains(., '(*anyTextToSearch*')]
或在 SQL2 中
SELECT * FROM [nt:unstructured] AS node
WHERE ISDESCENDANTNODE(node, "/search/in/path")
AND CONTAINS([propertyName], "*anyTextToSearch*")