0

How can I add a TokenFilter to StandardAnalyzer in Lucene? Or is there another Analyzer that does the same thing, only allows me to also use a TokenFilter?

I have a TokenFilter for Hunspell in C# which I am not sure where/how to plug in the process of indexing?

var analyzer = new StandardAnalyzer(Version.LUCENE_29);

var indexExists = IndexReader.IndexExists(directory);
var createIndex = (indexExists == false);

var indexWriter = new IndexWriter(directory, analyzer, createIndex, IndexWriter.MaxFieldLength.UNLIMITED);

....

indexWriter.AddDocument(document);

And I have on the other hand:

HunspellStemFilter : TokenFilter

From:

http://devhost.se/blog/post/2011/04/07/C-port-of-lucene-hunspell.aspx

Can anyone help?

Vladan Strigo
  • 551
  • 1
  • 7
  • 19

1 Answers1

0

There's an updated version with an example available at http://www.devhost.se/blog/post/2012/01/03/Updated-version-of-the-lucene-hunspell-port.aspx

You just swap out your StandardAnalyzer in your code with your new hunspell based analyzer.

sisve
  • 19,501
  • 3
  • 53
  • 95