mirror of https://github.com/apache/lucene.git
LUCENE-5859, LUCENE-5871: Remove Version.LUCENE_CURRENT from javadocs
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1619623 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
451aee2e66
commit
5e5072d3c2
|
@ -30,13 +30,13 @@ to check if the results are what we expect):</p>
|
|||
<!-- = Java2Html Converter 5.0 [2006-03-04] by Markus Gebhard markus@jave.de = -->
|
||||
<!-- = Further information: http://www.java2html.de = -->
|
||||
<pre class="prettyprint">
|
||||
Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_CURRENT);
|
||||
Analyzer analyzer = new StandardAnalyzer();
|
||||
|
||||
// Store the index in memory:
|
||||
Directory directory = new RAMDirectory();
|
||||
// To store an index on disk, use this instead:
|
||||
//Directory directory = FSDirectory.open("/tmp/testindex");
|
||||
IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_CURRENT, analyzer);
|
||||
IndexWriterConfig config = new IndexWriterConfig(analyzer);
|
||||
IndexWriter iwriter = new IndexWriter(directory, config);
|
||||
Document doc = new Document();
|
||||
String text = "This is the text to be indexed.";
|
||||
|
@ -48,7 +48,7 @@ to check if the results are what we expect):</p>
|
|||
DirectoryReader ireader = DirectoryReader.open(directory);
|
||||
IndexSearcher isearcher = new IndexSearcher(ireader);
|
||||
// Parse a simple query that searches for "text":
|
||||
QueryParser parser = new QueryParser(Version.LUCENE_CURRENT, "fieldname", analyzer);
|
||||
QueryParser parser = new QueryParser("fieldname", analyzer);
|
||||
Query query = parser.parse("text");
|
||||
ScoreDoc[] hits = isearcher.search(query, null, 1000).scoreDocs;
|
||||
assertEquals(1, hits.length);
|
||||
|
|
Loading…
Reference in New Issue