Changeset 3

Show
Ignore:
Timestamp:
01/29/07 01:06:31
Author:
kryswilken
Message:

--

Files:

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 
    110"""turbolucene -- Provides search functionality for TurboGears using PyLucene. 
    211 
     
    4756log = getLogger('turbolucene') 
    4857_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 
    5059_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. 
    5261#TODO: These should be configurable. 
    5362_index_directory = 'index' 
     
    91100    version of the search results that are passed to it by search().  Generally 
    92101    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 PythonThread 
    95     (like in a CherryPy thread, for example) and so can safely access your 
    96     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. 
    97106 
    98107    Example make_document function: 
     
    178187 
    179188    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 list 
    181     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. 
    182191 
    183192    """