Commits

Micha Kops committed 22dde99

FSDirectory replaced with MMapDirectory.

  • Participants
  • Parent commits d8dadc1

Comments (0)

Files changed (2)

src/main/java/com/hascode/tutorial/FacetingExample.java

 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.TopScoreDocCollector;
 import org.apache.lucene.store.Directory;
-import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.store.MMapDirectory;
 import org.apache.lucene.util.Version;
 
 public class FacetingExample {
 	private static final String INDEX_TAXO = "target/facet/taxo";
 
 	public static void main(final String[] args) throws IOException {
-		Directory dir = FSDirectory.open(new File(INDEX));
-		Directory taxoDir = FSDirectory.open(new File(INDEX_TAXO));
+		Directory dir = MMapDirectory.open(new File(INDEX));
+		Directory taxoDir = MMapDirectory.open(new File(INDEX_TAXO));
 		Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_40);
 		IndexWriterConfig iwc = new IndexWriterConfig(Version.LUCENE_40,
 				analyzer);

src/main/java/com/hascode/tutorial/IndexStatsExample.java

 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.store.MMapDirectory;
 import org.apache.lucene.util.Version;
 
 public class IndexStatsExample {
 
 	public static void main(final String[] args) throws IOException {
 		createRandomData();
-
-		IndexReader reader = DirectoryReader.open(FSDirectory.open(new File(
+		IndexReader reader = DirectoryReader.open(MMapDirectory.open(new File(
 				INDEX)));
 		IndexSearcher searcher = new IndexSearcher(reader);
 		CollectionStatistics stats = searcher.collectionStatistics("title");