Expand my Community achievements bar.

aem 6.1 SP2 special character search

Avatar

Level 4

Hi guys,

I am seeking some advise on how to enable AEM Asset search to find assets containing metadata with special characters. I have an asset with "?????" (5 question marks) in my DAM but when I try and search for it I get no results. Furthermore, some of the other special characters (the backslash \ for example) are not working as expected. If the question mark were being interpreted, something like "\?" should make it explicit that the question mark is a literal question mark, but this isn't working either.

While doing research I found an explanation for why special characters are not working as expected. The explanation is in this post.

Basically it's because the default lucene analyzer will trim the special characters, and the recommendation is to come up with your own analyzer to take into account special characters.

I have Lucene version 4.7.1 and so I went to check out the proper documentation to see how to come up with such an analyzer. Within the Lucene documentation there is a link to a request that resembles what I am trying to do. See request here.

As instructed I went back to my AEM instance to find the corresponding index (double checked the right index with the Explain Query tool) to put the desired configuration in place. I created /oak:index/damAssetLucene/analyzers (nt:unstructured) and added the boolean property indexOriginalTerm (set to true).

Even after putting in place the above configuration, a search for "?????" still won't return the one asset that has that metadata.

Is there anything I am missing? It seems this would be something people are trying to configure quite often, but I could not find an example of how to configure the special character lucene analyzer for AEM. Can someone provide an example? or an explanation of why doing so would be a very bad idea?

I am also aware of the AEM documentation about lucene analyzers here, and the JCR 2.0 Specification where it explains how the fulltext search is supposed to work.

Thanks a bunch,

何塞。

1 Reply

Avatar

Level 7

Have you already tried to change the Apache Sling Request Parameter Handling configuration?

You can select like Default parameter encoding the UTF-8 instead of ISO.