lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Corbin, J.D." <jd.cor...@pearson.com>
Subject Proper Use of SynonymGraphFilter
Date Mon, 13 Feb 2017 20:19:42 GMT
Hi,

I am looking for some guidance on the proper use of the SynonymGraphFilter
in Lucene (6.4.1).

Below is how I am implementing the analyzers for the index and query sides.
I don't see a lot of examples on the proper usage of the SynonymGraphFilter
so was hoping that someone (Michael McCandless?) might be able to shed some
like on how to use this filter, both on the index and query side.

I have defined a custom analyzer that I specify at index time, it contains
among other things, the following code block in the createComponents():

Note: getSynonyms() loads from Wordnet data

      SynonymMap synonyms = getSynonyms();

      if (synonyms != null) {

          result = new SynonymGraphFilter(result, synonyms, true);

          result = new FlattenGraphFilter(result);       // is this
required when indexing?

      }


... and on the query side, my analyzer (createComponents),  includes the
following:


        SynonymMap synonyms = getSynonyms();

        if (synonyms != null)

        {

            result = new SynonymGraphFilter(result, synonyms, true);

            // note: not flattening on the query side... is this correct or
should I flatten on both sides (e.g., use same analyzer for both index and
query)

        }


J.D. Corbin

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message