Changeset 3
- Timestamp:
- 01/29/07 01:06:31
- Files:
-
- turbolucene/trunk/LICENSE (added)
- turbolucene/trunk/ez_setup.py (added)
- turbolucene/trunk/setup.py (added)
- turbolucene/trunk/turbolucene.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
turbolucene/trunk/turbolucene.py
r2 r3 1 #============================================================================== 2 # 3 # Copyright (c) 2007 Krys Wilken 4 # 5 # This software is licensed under the MIT license. See the LICENSE file for 6 # licensing information. 7 # 8 #============================================================================== 9 1 10 """turbolucene -- Provides search functionality for TurboGears using PyLucene. 2 11 … … 47 56 log = getLogger('turbolucene') 48 57 _indexer = _searcher_factory = None # These will hold singleton classes. 49 _make_document = None # This will hold the user supplied make_document function .58 _make_document = None # This will hold the user supplied make_document function 50 59 _results_formatter = None # This will hold the user supplied results_formatter. 51 _search_fields = None # The fields to search 60 _search_fields = None # The fields to search. 52 61 #TODO: These should be configurable. 53 62 _index_directory = 'index' … … 91 100 version of the search results that are passed to it by search(). Generally 92 101 the results_formatter will take the list if ID strings that is passed to it 93 and return a list of application-specific objects (like SQLObject instances,94 for example.) This function operates outside of any PyLucene PythonThread95 (like in a CherryPy thread, for example) and so can safely access your96 model objects and request info.102 and return a list of application-specific objects (like SQLObject 103 instances, for example.) This function operates outside of any PyLucene 104 PythonThread (like in a CherryPy thread, for example) and so can safely 105 access your model objects and request info. 97 106 98 107 Example make_document function: … … 178 187 179 188 If a results_formatter function was passed to start() then the results will 180 be passed through the formatter before returning. If not, results is a list181 of strings that are the IDs of matching entries.189 be passed through the formatter before returning. If not, results is a 190 list of strings that are the IDs of matching entries. 182 191 183 192 """
