lucene-pylucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject svn commit: r1465463 - /lucene/pylucene/trunk/samples/ThreadIndexFiles.py
Date Sun, 07 Apr 2013 21:03:05 GMT
Author: vajda
Date: Sun Apr  7 21:03:05 2013
New Revision: 1465463

URL: http://svn.apache.org/r1465463
Log:
migrated ThreadIndexFiles.py

Modified:
    lucene/pylucene/trunk/samples/ThreadIndexFiles.py

Modified: lucene/pylucene/trunk/samples/ThreadIndexFiles.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/samples/ThreadIndexFiles.py?rev=1465463&r1=1465462&r2=1465463&view=diff
==============================================================================
--- lucene/pylucene/trunk/samples/ThreadIndexFiles.py (original)
+++ lucene/pylucene/trunk/samples/ThreadIndexFiles.py Sun Apr  7 21:03:05 2013
@@ -14,24 +14,29 @@
 
 # This sample illustrates how to use a thread with PyLucene
 
-import sys, os, threading
+INDEX_DIR = "ThreadIndexFiles.index"
+
+import sys, os, threading, lucene
 
 from datetime import datetime
-from lucene import StandardAnalyzer, VERSION, initVM, Version
 from IndexFiles import IndexFiles
 
+from org.apache.lucene.analysis.standard import StandardAnalyzer
+from org.apache.lucene.util import Version
+
 
 if __name__ == '__main__':
     if len(sys.argv) < 2:
         print IndexFiles.__doc__
         sys.exit(1)
-    env=initVM()
-    print 'lucene', VERSION
+    env=lucene.initVM()
+    print 'lucene', lucene.VERSION
 
     def fn():
+        base_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
         env.attachCurrentThread()
         start = datetime.now()
-        IndexFiles(sys.argv[1], "index",
+        IndexFiles(sys.argv[1], os.path.join(base_dir, INDEX_DIR),
                    StandardAnalyzer(Version.LUCENE_CURRENT))
         end = datetime.now()
         print end - start



Mime
View raw message