You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-commits@lucene.apache.org by va...@apache.org on 2022/01/04 19:32:58 UTC

svn commit: r1896677 - in /lucene/pylucene/trunk/samples: FacetExample.py IndexFiles.py SearchFiles.py TermPositionVector.py manindex.py mansearch.py

Author: vajda
Date: Tue Jan  4 19:32:58 2022
New Revision: 1896677

URL: http://svn.apache.org/viewvc?rev=1896677&view=rev
Log:
quick pass at samples, renamed some imports

Modified:
    lucene/pylucene/trunk/samples/FacetExample.py
    lucene/pylucene/trunk/samples/IndexFiles.py
    lucene/pylucene/trunk/samples/SearchFiles.py
    lucene/pylucene/trunk/samples/TermPositionVector.py
    lucene/pylucene/trunk/samples/manindex.py
    lucene/pylucene/trunk/samples/mansearch.py

Modified: lucene/pylucene/trunk/samples/FacetExample.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/samples/FacetExample.py?rev=1896677&r1=1896676&r2=1896677&view=diff
==============================================================================
--- lucene/pylucene/trunk/samples/FacetExample.py (original)
+++ lucene/pylucene/trunk/samples/FacetExample.py Tue Jan  4 19:32:58 2022
@@ -40,7 +40,7 @@ from java.util import Arrays
 
 from org.apache.lucene.analysis.core import WhitespaceAnalyzer
 from org.apache.lucene.search import IndexSearcher, TermQuery, MatchAllDocsQuery
-from org.apache.lucene.store import FSDirectory, SimpleFSDirectory
+from org.apache.lucene.store import FSDirectory, NIOFSDirectory
 from org.apache.lucene.index import (IndexWriter, IndexReader,
                                      DirectoryReader, Term,
                                      IndexWriterConfig)
@@ -226,8 +226,8 @@ class FacetExample(object):
         self.directory = directory
         # create Directories for the search index and for the taxonomy index
         # in RAM or on Disc
-        #indexDir = RAMDirectory()
-        #taxoDir = RAMDirectory()
+        #indexDir = ByteBuffersDirectory()
+        #taxoDir = ByteBuffersDirectory()
         self.indexDir = FSDirectory.open(Paths.get(os.path.join(self.directory,
                                                                 INDEX_DIR)))
         self.taxoDir = FSDirectory.open(Paths.get(os.path.join(self.directory,

Modified: lucene/pylucene/trunk/samples/IndexFiles.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/samples/IndexFiles.py?rev=1896677&r1=1896676&r2=1896677&view=diff
==============================================================================
--- lucene/pylucene/trunk/samples/IndexFiles.py (original)
+++ lucene/pylucene/trunk/samples/IndexFiles.py Tue Jan  4 19:32:58 2022
@@ -11,7 +11,7 @@ from org.apache.lucene.analysis.standard
 from org.apache.lucene.document import Document, Field, FieldType
 from org.apache.lucene.index import \
     FieldInfo, IndexWriter, IndexWriterConfig, IndexOptions
-from org.apache.lucene.store import SimpleFSDirectory
+from org.apache.lucene.store import NIOFSDirectory
 
 """
 This class is loosely based on the Lucene (java implementation) demo class

Modified: lucene/pylucene/trunk/samples/SearchFiles.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/samples/SearchFiles.py?rev=1896677&r1=1896676&r2=1896677&view=diff
==============================================================================
--- lucene/pylucene/trunk/samples/SearchFiles.py (original)
+++ lucene/pylucene/trunk/samples/SearchFiles.py Tue Jan  4 19:32:58 2022
@@ -8,7 +8,7 @@ from java.nio.file import Paths
 from org.apache.lucene.analysis.standard import StandardAnalyzer
 from org.apache.lucene.index import DirectoryReader
 from org.apache.lucene.queryparser.classic import QueryParser
-from org.apache.lucene.store import SimpleFSDirectory
+from org.apache.lucene.store import NIOFSDirectory
 from org.apache.lucene.search import IndexSearcher
 
 """

Modified: lucene/pylucene/trunk/samples/TermPositionVector.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/samples/TermPositionVector.py?rev=1896677&r1=1896676&r2=1896677&view=diff
==============================================================================
--- lucene/pylucene/trunk/samples/TermPositionVector.py (original)
+++ lucene/pylucene/trunk/samples/TermPositionVector.py Tue Jan  4 19:32:58 2022
@@ -3,7 +3,7 @@ import lucene
 
 from org.apache.lucene.analysis.miscellaneous import LimitTokenCountAnalyzer
 from org.apache.lucene.analysis.standard import StandardAnalyzer
-from org.apache.lucene.store import RAMDirectory
+from org.apache.lucene.store import ByteBuffersDirectory
 from org.apache.lucene.document import Document, Field, FieldType
 from org.apache.lucene.util import BytesRef, BytesRefIterator
 from org.apache.lucene.index import \
@@ -12,7 +12,7 @@ from org.apache.lucene.index import \
 if __name__ == '__main__':
     lucene.initVM(vmargs=['-Djava.awt.headless=true'])
 
-directory = RAMDirectory()
+directory = ByteBuffersDirectory()
 iconfig = IndexWriterConfig(LimitTokenCountAnalyzer(StandardAnalyzer(), 100))
 iwriter = IndexWriter(directory, iconfig)
 

Modified: lucene/pylucene/trunk/samples/manindex.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/samples/manindex.py?rev=1896677&r1=1896676&r2=1896677&view=diff
==============================================================================
--- lucene/pylucene/trunk/samples/manindex.py (original)
+++ lucene/pylucene/trunk/samples/manindex.py Tue Jan  4 19:32:58 2022
@@ -26,7 +26,7 @@ from org.apache.lucene.analysis.miscella
 from org.apache.lucene.analysis.standard import StandardAnalyzer
 from org.apache.lucene.index import IndexWriter, IndexWriterConfig
 from org.apache.lucene.document import Document, Field, StringField, TextField
-from org.apache.lucene.store import SimpleFSDirectory
+from org.apache.lucene.store import NIOFSDirectory
 
 def indexDirectory(dir):
 

Modified: lucene/pylucene/trunk/samples/mansearch.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/samples/mansearch.py?rev=1896677&r1=1896676&r2=1896677&view=diff
==============================================================================
--- lucene/pylucene/trunk/samples/mansearch.py (original)
+++ lucene/pylucene/trunk/samples/mansearch.py Tue Jan  4 19:32:58 2022
@@ -32,7 +32,7 @@ from org.apache.lucene.analysis.standard
 from org.apache.lucene.index import DirectoryReader
 from org.apache.lucene.queryparser.classic import QueryParser
 from org.apache.lucene.search import IndexSearcher
-from org.apache.lucene.store import SimpleFSDirectory
+from org.apache.lucene.store import NIOFSDirectory
 
 if __name__ == '__main__':
     lucene.initVM(vmargs=['-Djava.awt.headless=true'])