diff --git a/src/java/overview.html b/src/java/overview.html
index 90144b5f07f..88e342c7a3c 100644
--- a/src/java/overview.html
+++ b/src/java/overview.html
@@ -27,7 +27,7 @@ to check if the results are what we expect):
-
+
@@ -35,7 +35,7 @@ to check if the results are what we expect):
- Analyzer analyzer = new StandardAnalyzer();
+ Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_CURRENT);
// Store the index in memory:
Directory directory = new RAMDirectory();
@@ -51,7 +51,7 @@ to check if the results are what we expect):
iwriter.close();
// Now search the index:
- IndexSearcher isearcher = new IndexSearcher(directory);
+ IndexSearcher isearcher = new IndexSearcher(directory, true); // read-only=true
// Parse a simple query that searches for "text":
QueryParser parser = new QueryParser("fieldname", analyzer);
Query query = parser.parse("text");
@@ -68,12 +68,14 @@ to check if the results are what we expect):
|
+
+
The Lucene API is divided into several packages:
diff --git a/src/test/org/apache/lucene/TestDemo.java b/src/test/org/apache/lucene/TestDemo.java
index 6609e7347eb..8a75ab7cc4b 100644
--- a/src/test/org/apache/lucene/TestDemo.java
+++ b/src/test/org/apache/lucene/TestDemo.java
@@ -32,6 +32,7 @@ import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.Version;
import org.apache.lucene.util._TestUtil;
/**
@@ -44,12 +45,12 @@ public class TestDemo extends LuceneTestCase {
public void testDemo() throws IOException, ParseException {
- Analyzer analyzer = new StandardAnalyzer();
+ Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_CURRENT);
// Store the index in memory:
Directory directory = new RAMDirectory();
// To store an index on disk, use this instead:
- //Directory directory = FSDirectory.open(new File("/tmp/testindex"));
+ //Directory directory = FSDirectory.open("/tmp/testindex");
IndexWriter iwriter = new IndexWriter(directory, analyzer, true,
new IndexWriter.MaxFieldLength(25000));
Document doc = new Document();
@@ -58,11 +59,9 @@ public class TestDemo extends LuceneTestCase {
Field.Index.ANALYZED));
iwriter.addDocument(doc);
iwriter.close();
-
- _TestUtil.checkIndex(directory);
// Now search the index:
- IndexSearcher isearcher = new IndexSearcher(directory);
+ IndexSearcher isearcher = new IndexSearcher(directory, true); // read-only=true
// Parse a simple query that searches for "text":
QueryParser parser = new QueryParser("fieldname", analyzer);
Query query = parser.parse("text");