[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
- [GMG-Devel] [PATCH 00/83] Search plugin, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 01/83] Register search plugin with mediagoblin.ini, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 02/83] Correct indices storage dictionary in config_spec.ini, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 03/83] Refactor exceptions raised by the search plugin, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 04/83] Fix typos in search.models, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 05/83] Rename models.py to indices.py as these will not be stored in db., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 06/83] Remove global constants from the top of indices.py, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 07/83] Fix imports and other bugs in indices.py, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 08/83] Add schemas.py which will store all index schemas., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 09/83] Store also the field names in the SearchIndex object which is also necessary while searching.,
Alon Levy <=
- [GMG-Devel] [PATCH 10/83] Correct the class index schema class., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 11/83] Add indexer for MediaEntry objects., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 12/83] Add IndexRegistry class to maintain the search indices., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 13/83] Clean up plugins.search.indices, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 14/83] Rename base.py to registry.py and indices.py to base.py., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 15/83] Add index identifier to SearchIndex., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 16/83] Correct the index identifier., Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 17/83] Collect all indices in indices.py, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 18/83] Add method to create a document from a model instance, Alon Levy, 2014/02/25
- [GMG-Devel] [PATCH 19/83] Add event listeners for tracking ORM events for indices., Alon Levy, 2014/02/25