Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

autocomplete - slowness while opening dialog

Avatar

Level 4

Hello All,

In our component dialog, we have an autocomplete element/control, which loads tags from /etc/tags/xyz, when we search with a keyword. "/services/search/tags” is a custom Servlet which loads/autocomplete tags based on keyword search.

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:granite="http://www.adobe.com/jcr/granite/1.0"
xmlns:cq="http://www.day.com/jcr/cq/1.0"
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/autocomplete"
granite:class="cq-dialog-tags-enabledisable"
fieldLabel="Tags"
multiple="{Boolean}true"
name="./aaa:tagName"
>
<
datasource
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/common/datasources/tags"
/>
<
values
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/autocomplete/tags"
/>
<
options
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/autocomplete/list"
src="/services/search/tags?query={query}"
/>
</
jcr:root>

But because of above autocomplete, when we open dialog, it is taking around 30 seconds to open.

When we enable DEBUG logs for below API and captured the logs while opening dialing, we observed that, while opening dialog it is traversing all nodes under /etc/tags and thus it is taking time to load.

org.apache.jackrabbit.oak.plugins.index

org.apache.jackrabbit.oak.query

com.day.cq.search

DEBUG LOG:

  27.09.2018 05:11:04.923 *DEBUG* [10.246.75.239 [1538039455444] GET /mnt/override/apps/xyz/components/content/site/component-pqr/_cq_dialog.html/content/admin/zzzz/jcr:content/lhs/component-abc_ HTTP/1.1] org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex loading the next 51200 entries for query +(jcr:primaryType:cq:Tag) +:ancestors:/etc/tags/xyz

  Why is it traversing /etc/tags while opening the dialog? We don’t want to traverse or load the tags on dialog open.

Please help us to solve this performance issue of dialog.

Thanks in advance


 


Your Personal Data: We may collect and process information about you that may be subject to data protection laws. For more information about how we use and disclose your personal data, how we protect your information, our legal basis to use your information, your rights and who you can contact, please refer to: www.gs.com/privacy-notices

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

What do you want to achieve?I think It is traversing /etc/tags because of OOTB datasource .

sling:resourceType="cq/gui/components/common/datasources/tags

If you want your own list , try to create new datasource and use that.

Please check below for sample code to create datasource

Search/Filter Touch UI Dialog Dropdown in AEM

Adobe Experience Manager Help | Using Granite DataSource objects to populate AEM Touch UI objects



Arun Patidar

View solution in original post

3 Replies

Avatar

Employee

What version of AEM do you use?

Do you see in a log file an output similar to "*WARN* Traversed 1000 nodes with filter Filter.."?

Avatar

Correct answer by
Community Advisor

Hi,

What do you want to achieve?I think It is traversing /etc/tags because of OOTB datasource .

sling:resourceType="cq/gui/components/common/datasources/tags

If you want your own list , try to create new datasource and use that.

Please check below for sample code to create datasource

Search/Filter Touch UI Dialog Dropdown in AEM

Adobe Experience Manager Help | Using Granite DataSource objects to populate AEM Touch UI objects



Arun Patidar

Avatar

Level 10

Correct - set your datasource to a smaller set --

AUtoComplete.png

Your data set is simply too large - that is the issue.