[Hippo-cms7-user] synonyms in hippo-lucene

Frank van Lankvelt f.vanlankvelt at onehippo.com
Thu Jun 9 11:26:32 CEST 2011


you should be able to provide synonyms by implementing the JackRabbit
SynonymProvider class, or by using the existing
PropertiesSynonymProvider.  Adding the "synonymProviderClass"
parameter to the SearchIndex configuration should work.
AFAIK, the underlying jackrabbit repository configuration [1] should
take care of this.

cheers, Frank


[1] http://wiki.apache.org/jackrabbit/Search

On Thu, Jun 9, 2011 at 10:39 AM, Adolfo Benedetti
<adolfo.benedetti at gmail.com> wrote:
> Hi everyone,
>
> In order to make use of the synonyms functionality present in
> lucene[1][2] for a non-english language, can somebody point me to the
> documentation hippo7.5-lucene internals[3],
>
> Thank you in advance,
> Cheers
>
> Adolfo
>
> ///
>  String[] words = new String[] { "hard", "woods", "forest", "wolfish", "xxxx"};
>  SynonymMap map = new SynonymMap(new
> FileInputStream("samples/fulltext/wn_s.pl"));
>  for (int i = 0; i < words.length; i++) {
>    String[] synonyms = map.getSynonyms(words[i]);
>    System.out.println(words[i] + ":" +
> java.util.Arrays.asList(synonyms).toString());
>  }
>
>  ////
>  Example output:
>  hard:[arduous, backbreaking, difficult, fermented, firmly, grueling,
> gruelling, heavily, heavy, intemperately, knockout, laborious,
> punishing, severe, severely, strong, toilsome, tough]
>  woods:[forest, wood]
>  forest:[afforest, timber, timberland, wood, woodland, woods]
>  wolfish:[edacious, esurient, rapacious, ravening, ravenous,
> voracious, wolflike]
>  xxxx:[]
>
> [1]http://lucene.apache.org/java/2_9_2/api/contrib-memory/org/apache/lucene/index/memory/SynonymTokenFilter.html
> [2]http://lucene.apache.org/java/2_9_2/api/contrib-memory/org/apache/lucene/index/memory/SynonymMap.html
> [3]http://www.onehippo.org/search?q=lucene
>
> --
> Adolfo Benedetti
> Mobile: +31 6 46436090
> Sourcesense - making sense of Open Source: http://www.sourcesense.nl
> Herengracht 124 - 128
> 1015 BT Amsterdam
> T +31 20 5708949
> F +31 20 5708989
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html
>



-- 
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com



More information about the Hippo-cms7-user mailing list