package com.siirush.localwiki.search;

import java.util.List;

import javax.inject.Inject;
import javax.inject.Provider;

import org.apache.lucene.store.Directory;

public class LuceneSearchEngineImpl implements SearchEngine {
	private Directory index;
	private final Provider<LuceneFileCrawler> crawlerProvider;
	private final Provider<LuceneSearcher> searchProvider;
	
	@Inject
	public LuceneSearchEngineImpl(Provider<LuceneFileCrawler> crawlerProvider, Provider<LuceneSearcher> searchProvider) {
		this.crawlerProvider = crawlerProvider;
		this.searchProvider = searchProvider;
	}
	
	public void index() {
		index = crawlerProvider.get().crawl();
	}

	public List<String> search(String query) {
		return searchProvider.get().search(index,query);
	}
}

@@ -317,33 +317,24 @@
 ivate final 
-Provider%3C
 LuceneSearch
@@ -335,30 +335,23 @@
 Searcher
-%3E
  search
-Provid
 er;%0A%09%0A%09@
@@ -433,25 +433,16 @@
 ovider, 
-Provider%3C
 LuceneSe
@@ -451,22 +451,15 @@
 cher
-%3E
  search
-Provid
 er) 
@@ -515,22 +515,16 @@
 s.search
-Provid
 er = sea
@@ -526,22 +526,16 @@
 = search
-Provid
 er;%0A%09%7D%0A%09
@@ -662,30 +662,18 @@
 n search
-Provider.get()
+er
 .search(

Change the scope of the injection for searchers.