2

I have a synonym table with list of synonyms comma separated. I want Lucene to consider these synonyms also while I indexing a text value. I am using StandardAnalyzer to Index. How can I make Lucene to make use of Synonym as well? Here is my code using StandardAnalyzer

FSDirectory fsDircetory = FSDirectory.open(new File("/home/lenovo/index"));
indexwriter = new IndexWriter(fsDircetory,
    new StandardAnalyzer(Version.LUCENE_31),
    true,IndexWriter.MaxFieldLength.LIMITED);
Document doc = new Document();
doc.add(new Field("title",recipeVO.getTitle(),
    Field.Store.YES,Field.Index.ANALYZED));
indexwriter.addDocument(doc);
indexwriter.close()
Gene Golovchinsky
  • 6,101
  • 7
  • 53
  • 81
Ananth Duari
  • 2,859
  • 11
  • 35
  • 42

0 Answers0