Mercurial > wikked
comparison 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 |
comparison
equal
deleted
inserted
replaced
150:800a1f681557 | 151:f32af0888382 |
---|---|
36 print "[users]" | 36 print "[users]" |
37 print "%s = %s" % (username, password) | 37 print "%s = %s" % (username, password) |
38 | 38 |
39 | 39 |
40 @manager.command | 40 @manager.command |
41 def reset(cache=False): | 41 def reset(cache=False, index_only=False): |
42 """ Re-generates the database and the full-text-search index. | 42 """ Re-generates the database and the full-text-search index. |
43 """ | 43 """ |
44 wiki.reset(cache_ext_data=cache) | 44 if index_only: |
45 wiki.index.reset(wiki.getPages()) | |
46 else: | |
47 wiki.reset(cache_ext_data=cache) | |
45 | 48 |
46 | 49 |
47 @manager.command | 50 @manager.command |
48 def update(url=None, cache=False): | 51 def update(url=None, cache=False): |
49 """ Updates the database and the full-text-search index with any | 52 """ Updates the database and the full-text-search index with any |
83 return | 86 return |
84 print page.text | 87 print page.text |
85 | 88 |
86 | 89 |
87 @manager.command | 90 @manager.command |
91 def search(query): | |
92 """ Searches the wiki. | |
93 """ | |
94 hits = wiki.index.search(query) | |
95 print hits | |
96 | |
97 | |
98 @manager.command | |
88 def linksfrom(url): | 99 def linksfrom(url): |
89 page = wiki.getPage(url) | 100 page = wiki.getPage(url) |
90 for l in page.links: | 101 for l in page.links: |
91 print l | 102 print l |
92 | 103 |