I am creating a lucene search application, I used multiple instances of indexWriter with different analyzers and respective indexSearcher, but the search results returned are empty even though I know I have indexed the particular word I'm searching for.
Here is my SearchEngine class constructor
this.indexers = new ArrayList<StandardIndexer>();
this.indexers.add(new StandardIndexer(new StandardAnalyzer()));
this.indexers.add(new StandardIndexer(new EnglishStemAnalyzer()));
this.indexers.add(new StandardIndexer(new KeywordAnalyzer()));
this.indexers.add(new StandardIndexer(new EnglishSynonymAnalyzer()));
this.indexers.add(new StandardIndexer(new EnglishSynonymStemAnalyzer()));
this.indexers.add(new StandardIndexer(new EnglishSynonymKeywordAnalyzer()));
this.searchers = new ArrayList<StandardSearcher>();
for (StandardIndexer indexer : this.indexers) {
this.searchers.add(new StandardSearcher(indexer));
}
StandardIndexer and StandardSearcher are my implementations of indexer and searcher, as we can see instance of indexer is used in creation of indexSearcher, hence directory and type of analyzer used is also shared between pairs of indexer and searcher