Gary Behan
Gary Behan

Reputation: 25

AEM Query Builder: Need to search for specific text on all properties on all pages

I need to do a search for all nodes that contain a specific piece of text. I know I can use the LIKE operation for this, but the issue is how to search for the string when you are not specifying any properties? Basically if any property on any node on any page contains the string, I wwant to return those results?

Can anyone help?

G

Upvotes: 1

Views: 6824

Answers (2)

Akshay Rathnavas
Akshay Rathnavas

Reputation: 358

You can use this to search for any substring inside any properties under any path using AEM Query Builder. You can use asterisk or * If you do not want a substring and just the full text then remove the "*" and give the search text;

path=/content
fulltext=*anyTextToSearch*

OR IN XPATH Query

/jcr:root/content/path/to/page//*[jcr:contains(., '(*anyTextToSearch*')]

OR IN SQL2

SELECT * FROM [nt:unstructured] AS node
WHERE ISDESCENDANTNODE(node, "/search/in/path")
AND CONTAINS([propertyName], "*anyTextToSearch*")

Upvotes: 3

raju muddana
raju muddana

Reputation: 154

I think you can try 'fulltext' search,

path=/content
fulltext=searchtext

Upvotes: 0

Related Questions