Could you share the details of your SynonymFilter? Is it adding tokens into the same position as the original tokens (position increment of 0)? Are you using QueryParser for searching? If so, try TermQuery to eliminate the parser's analysis from the picture for the time being while trouble shooting.

If you are using QueryParser, are you using the same analyzer? If this is the case, what is the .toString of the generated Query?

        Erik


On Jan 16, 2006, at 3:54 AM, jason wrote:

Hi,

I got a problem of using the lucene.

I write a SynonymFilter which can add synonyms from the WordNet. Meanwhile, i used the SnowballFilter for term stemming. However, i got a problem when
combining the two fiters.

For instance, i got 17 documents containing the Term "support" and the
following is the SynonymAnalyzer i wrote.

/**
*
*/
 public TokenStream tokenStream(String fieldName, Reader reader){


        TokenStream result = new StandardTokenizer(reader);
        result = new StandardFilter(result);
        result = new LowerCaseFilter(result);
        if (stopword != null){
          result = new StopFilter(result, stopword);
        }

        result = new SnowballFilter(result, "Lovins");

       result = new SynonymFilter(result, engine);

        return result;
    }

If i only used the SnowballFilter, i can find the "support" in the 17
documents. However, after adding the SynonymFilter, the "support" can only be found in 10 documents. It seems the term "support" cannot be found in the
left 7 documents. I dont know what's wrong with it.

regards

jiang xing


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to