From 2a92080b0d771caea89575f66c5545897397f9a7 Mon Sep 17 00:00:00 2001 From: Marcin Koziej Date: Wed, 12 Oct 2011 09:49:12 +0200 Subject: [PATCH] search commit while struggling with pylucene --- apps/search/__init__.py | 1 + apps/search/index.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 apps/search/__init__.py create mode 100644 apps/search/index.py diff --git a/apps/search/__init__.py b/apps/search/__init__.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/apps/search/__init__.py @@ -0,0 +1 @@ + diff --git a/apps/search/index.py b/apps/search/index.py new file mode 100644 index 000000000..8f7722a77 --- /dev/null +++ b/apps/search/index.py @@ -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, ) + -- 2.20.1