mediagoblin-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GMG-Devel] [PATCH 09/83] Store also the field names in the SearchIndex


From: Alon Levy
Subject: [GMG-Devel] [PATCH 09/83] Store also the field names in the SearchIndex object which is also necessary while searching.
Date: Tue, 25 Feb 2014 21:57:52 +0200

From: Praveen Kumar <address@hidden>

---
 mediagoblin/plugins/search/indices.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mediagoblin/plugins/search/indices.py 
b/mediagoblin/plugins/search/indices.py
index c33bf70..086271b 100644
--- a/mediagoblin/plugins/search/indices.py
+++ b/mediagoblin/plugins/search/indices.py
@@ -21,6 +21,7 @@ class SearchIndex(object):
     
     def __init__(self, search_index_dir=None, use_multiprocessing=None):
         self.schema = None
+        self.field_names = None
         self.search_index = None
         self.search_index_name = self.__class__.__name__.lower()
         
@@ -75,7 +76,9 @@ class SearchIndex(object):
 
         self.search_index = whoosh.index.create_in(self.search_index_dir,
                 indexname=self.search_index_name, schema=schema)
-         
+        
+        self.field_names = schema.names()
+
     def add_document(self, **document):
         """
         Adds a document to the index represented by this class.
-- 
1.8.5.3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]