AEM 6.1 - Search synonyms | Community
Skip to main content
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 leeasling

You know, it actually looks like it's not supported.

See here: http://www.slideshare.net/justinedelson/demystifying-oak-search slide 40 and 41, specifically states that synonyms are not supported.

9 replies

Level 8
December 22, 2015

I believe you can utilize the tilde (~) to do this.

francisco_ribei
Level 6
December 22, 2015

Hi @leeasling,

But where do I configure the synonyms?

Thanks

leeaslingAccepted solution
Level 8
December 22, 2015

You know, it actually looks like it's not supported.

See here: http://www.slideshare.net/justinedelson/demystifying-oak-search slide 40 and 41, specifically states that synonyms are not supported.

francisco_ribei
Level 6
December 22, 2015

@leeasling I just saw this presentation.

Thanks for your help!

Pacoolsky
Level 2
December 22, 2015

Synonym weren't supported initially in AEM 6.0 / Oak 1.0.x.

In AEM 6.1 (Oak 1.2.x) it should work. You can configure synonyms in similar way how stop-words can be configured.
See https://jackrabbit.apache.org/oak/docs/query/lucene.html#Create_analyzer_via_composition and just replace, "Stop" node with the following "Synonym" node structure

+ Synonym
   - synonyms = "synonyms.txt"
   + synonyms.txt (nt:file)

Should work if didn't make a typo.

Adobe Employee
December 22, 2015

franciscoribeir wrote...

@leeasling I just saw this presentation.

Thanks for your help!

The presentation covers  OAK 1.0.5 (AEM 6.0 SP1)

Please try the suggestion from @Pacoolsky

francisco_ribei
Level 6
December 22, 2015

@Pacoolsky and @Opkar Gill,

I used this synonym.txt for testing:

aaafoo => aaabar bbbfoo => bbbfoo bbbbar cccfoo => cccbar cccbaz fooaaa,baraaa,bazaaa # Some synonym groups specific to this example GB,gib,gigabyte,gigabytes MB,mib,megabyte,megabytes Television, Televisions, TV, TVs clash, battle, fight #notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming #after us won't split it into two words. # Synonym mappings can be used for spelling correction too pixima => pixma teh => the tablet, tableau

I know that they are being loaded because if I put a wrong line it break.

But when I try to search for one of the synonyms it doesn't retrieve.

For example, I update one asset to have the "tablet" text and other to have "tableau".

If I search for tablet it retrieves only the tablet one not both tablet and tableau. The same happens for tableau.

is there any other config I should check?

Thanks

francisco_ribei
Level 6
December 22, 2015

Hey,

It worked!!

The problem was that I had two index and both were evaluated. Once I deleted one of them it worked.

Thanks

francisco_ribei
Level 6
December 22, 2015

One Thing I noticed after adding this analyzer config, is that some searches I was able to perform now are not working anymore.

For example, I was able to search by tags for example, if I have an Asset tagged with nature/geological_feature

I was able to return it searching for nature or geological, but now it is not working.

Do you know what are the default list of Filters used by lucene? So I can use them plus synonym filter?

Thanks