AEM TagManager Find() operation | Community
Skip to main content
Riju-Mahna
Level 2
November 27, 2017
Solved

AEM TagManager Find() operation

  • November 27, 2017
  • 4 replies
  • 3718 views

The find() method from com.day.cq.tagging.TagManager returns content even after the tag has been moved to a new name.

For example:

1. Create a tag "myNamespace:folder/tag"

2. Add this to a page under Geometrixx website

3. Run tagManager.find("/content/", new String[]{"myNamespace:folder/tag"});

4 .You will get 1 result (page tagged in step 2 above)

5. Move this tag to "myNamespace:folder/newTag"

5-B- Verify in CRX, the page shows the new tag now.

6. Again Run tagManager.find("/content/", new String[]{"myNamespace:folder/tag"});

7. This STILL returns the same page from step2 . Even though the tag has been moved and new name id present in CRX also.

Is this a bug in the OOTB functionality or am I missing something?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

The tag management implementation is a bit weird. Yeah, renaming might cause this behavior. Can you run the Tag Garbage Collector and check again afterwards?

Building Tagging into an AEM Application

Jörg

4 replies

joerghoh
Adobe Employee
Adobe Employee
November 27, 2017

Internally it is implemented using a JCR query; depending on the index type (property or Lucene index) there might a small lag between a change in the JCR and the time when this change gets reflected in the index. Typically it should not exceed 5 seconds. If your lag is larger, please check your log if you have any messages about indexing issues.

Jörg

Riju-Mahna
Level 2
November 27, 2017

Hi Jorg,

Thanks for your response.

There is no delay or errors in logs. I tried this in a vanilla 6.2 instance as well.

The logs printed :

27.11.2017 16:05:34.680 *INFO* [127.0.0.1 [1511816734671] POST /bin/tagcommand HTTP/1.1] com.day.cq.tagging.impl.JcrTagManagerImpl moving tag from /etc/tags/forum/topic/new-answer to /etc/tags/forum/topic/no-answer

27.11.2017 16:05:34.685 *INFO* [127.0.0.1 [1511816734671] POST /bin/tagcommand HTTP/1.1] com.day.cq.tagging.impl.JcrTagManagerImpl keeping hidden old version of tag at /etc/tags/forum/topic/new-answer

Both old and new tags are preserved by AEM. Old tag "new-answer" got a property 'cq:movedTo' while the new tag "no-answer" got the property 'cq:backlinks'

Are these properties causing this anomaly ?

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
November 27, 2017

The tag management implementation is a bit weird. Yeah, renaming might cause this behavior. Can you run the Tag Garbage Collector and check again afterwards?

Building Tagging into an AEM Application

Jörg

May 29, 2019

Hi Jorg,

I am also facing the same issue on 6.4, But running the Tag Garbage Collector and check again afterwards is not working in my case. I configured the garbage collector to every minute and tried to repeat the steps. Page Jcr:content property cq:tags are not updated as to the moved/updated tag path.

Could you please help on this?

ThanksSathish