Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

aem6.5 Indexing on OOTB query for find and replace text

Avatar

Avatar
Validate 25
Level 4
srinivas_chann1
Level 4

Likes

19 likes

Total Posts

222 posts

Correct Reply

6 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Validate 25
Level 4
srinivas_chann1
Level 4

Likes

19 likes

Total Posts

222 posts

Correct Reply

6 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
srinivas_chann1
Level 4

28-02-2021

Hi ,

 

We are using AEM6.5 OOTB find and replace functionality ,but noticed in the logs that this is causing lot of nodes to traversed hence want to index this 

 

Would need help  based on below as what is the query sent for this so that based on the query could be indexed   using the below https://oakutils.appspot.com/generate/index

 

From logs:-

org.apache.jackrabbit.oak.plugins.index.Cursors$TraversingCursor Traversed 15000 nodes with filter Filter(query=select [jcr:path], [jcr:score], from [nt:base] as a where isdescendantnode(a, '/content/project/us/en') or jcr:like(fn:lower-case(@searchPath),'%lorems%'))] option(traversal ok) /, path=/content/project/us/en//*, property=[function*lower*@searchPath=[(%lorems%..], searchPath=[is not null]]); consider creating an index or changing the query

 

1> What is the OOTB query sent for this

To find a text in the page ,

Say the page /content/project/us/en had text "abc" and must be replaced with "test"

 

We are using OOTB suffixes like  find.json  for this

 

http://localhost:4502/content/project/us/en.find.json?_charset_=utf-8&f=abc&cs=false&wwo=false&cq_ck=1614580151256

 

2> What is the OOTB query sent for this

To replace:-

We are using OOTB suffixes like replace.html  for this

http://localhost:4502/content/project/us/en.replace.html

With post data as below:-

 

p: /content/project/us/en
_charset_: utf-8
:status: browser
s: /content/project/us/en
f: abc
r: test

 

 

 

 

Thanks

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 50
MVP
Vijayalakshmi_S
MVP

Likes

436 likes

Total Posts

574 posts

Correct Reply

191 solutions
Top badges earned
Give Back 50
Give Back 5
Ignite 10
Ignite 5
Ignite 3
View profile

Avatar
Give Back 50
MVP
Vijayalakshmi_S
MVP

Likes

436 likes

Total Posts

574 posts

Correct Reply

191 solutions
Top badges earned
Give Back 50
Give Back 5
Ignite 10
Ignite 5
Ignite 3
View profile
Vijayalakshmi_S
MVP

01-03-2021

Hi @srinivas_chann1,

Create a logger configuration for the below mentioned classes(Debug) in Sling Log(http://localhost:4502/system/console/slinglog) and trigger find action.

org.apache.jackrabbit.oak.query
org.apache.jackrabbit.oak.query.QueryImpl
org.apache.jackrabbit.oak.query.SQL2Parser
org.apache.jackrabbit.oak.query.QueryEngineImpl

 

In particular,

  • org.apache.jackrabbit.oak.query.QueryEngineImpl will display information of xpath and sql2 query along the lines like "parsing xpath..", "xpath to sql2 conversion.." and "parsing sql2..."
  • org.apache.jackrabbit.oak.query.QueryImpl will then display cost calculation for the query.

Once you get the query from the logs, use Query Performance tool for further action. (Tools -> Diagnosis -> Query Performance -> Explain query)

Answers (0)