search commit while struggling with pylucene
authorMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Wed, 12 Oct 2011 07:49:12 +0000 (09:49 +0200)
committerMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Tue, 15 Nov 2011 13:24:18 +0000 (14:24 +0100)
apps/search/__init__.py [new file with mode: 0644]
apps/search/index.py [new file with mode: 0644]

diff --git a/apps/search/__init__.py b/apps/search/__init__.py
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/apps/search/index.py b/apps/search/index.py
new file mode 100644 (file)
index 0000000..8f7722a
--- /dev/null
@@ -0,0 +1,12 @@
+
+from django.conf import settings
+from lucene import SimpleFSDirectory, IndexWriter
+import os
+
+
+class BookSearch(object):
+    def __init__(self):
+        if not os.exists(settings.SEARCH_INDEX):
+            os.mkdir(settings.SEARCH_INDEX)
+        self.store = IndexWriter(store, )
+