Lucene Search returns no results, even if it

I am creating a lucene search application, I used several instances of indexWriter with different analyzers and the corresponding indexSearcher, but the returned search results are empty, although I know that I indexed the specific word I am looking for.

Here is my constructor for the SearchEngine class

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 the indexer and the search engine, since we see that the indexer instance is used to create the indexSearcher, so the directory used and the type of analyzer used are also shared between the pairs of the indexer and search engine

+4
source share
1 answer

.

, :

0

Source: https://habr.com/ru/post/1628069/


All Articles