Commits

hc committed 511a4bb

added LICENSE and README

  • Participants
  • Parent commits e3d1dba

Comments (0)

Files changed (2)

plugin_h_search/LICENSE

+Copyright (C) 2011 by Hans Christian von Stockhausen <hc at vst.io>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

plugin_h_search/README

+Search plugin for web2py (alpha)
+================================
+
+Author  : Hans Christian von Stockhausen <hc at vst.io>
+Date    : 2011-01-13
+Home    : http://bitbucket.org/hc/plugin_h_search
+License : MIT (see LICENSE)
+
+This module implements a simple search engine for web2py-powered sites. It is 
+intended for local site search on or off Google Appengine. Results are ranked 
+by keyword frequency, keyword position relative to the top of the page and 
+keyword proximity to one another. 
+The engine is based on "Programming Collective Intelligence" (Ch. 4).
+
+
+Dependencies
+------------
+
+This module requires the following third party modules:
+
+pyporter2     - https://github.com/mdirolf/pyporter2
+BeautifulSoup - www.crummy.com/software/BeautifulSoup/
+
+Note: The w2p plugin package contains these already for your convinience.
+
+
+Example 
+-------
+
+### models/mymodel.py
+search = local_import('plugin_h_search')
+search.create_tables(globals())
+
+### controllers/mycontroller.py
+search = local_import('plugin_h_search')
+
+@search.index(globals(), search.INDEX_DAILY)
+def foo():
+    return dict(message='Hello World')
+    
+def search():
+    return dict(results=search.search(globals(), request.vars.get('q'))
+  
+### views/mycontroller/static_search.html
+{{extend 'layout.html'}}
+{{for r in results:}}
+    {{=A(r.url, _href=r.url)}}
+{{pass}}