diff manage.py @ 151:f32af0888382

Added support for ElasticSearch indexing: - More configurable setup for wiki providers (SCM, indexing, etc.). - Lazy importing of provider specific packages. - Nicer search results.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 16 Dec 2013 20:59:42 -0800
parents 9d22cf4d2412
children
line wrap: on
line diff
--- a/manage.py	Sat Dec 14 21:29:22 2013 -0800
+++ b/manage.py	Mon Dec 16 20:59:42 2013 -0800
@@ -38,10 +38,13 @@
 
 
 @manager.command
-def reset(cache=False):
+def reset(cache=False, index_only=False):
     """ Re-generates the database and the full-text-search index.
     """
-    wiki.reset(cache_ext_data=cache)
+    if index_only:
+        wiki.index.reset(wiki.getPages())
+    else:
+        wiki.reset(cache_ext_data=cache)
 
 
 @manager.command
@@ -85,6 +88,14 @@
 
 
 @manager.command
+def search(query):
+    """ Searches the wiki.
+    """
+    hits = wiki.index.search(query)
+    print hits
+
+
+@manager.command
 def linksfrom(url):
     page = wiki.getPage(url)
     for l in page.links: