Show
Ignore:
Timestamp:
02/03/2010 06:45:12 PM (7 months ago)
Author:
matt
Message:

Work on NUMERIC, DATETIME, and BOOLEAN field types.
Changes instances of test_index to testindex.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • projects/whoosh/trunk/src/whoosh/qparser/simple.py

    r404 r415  
    8888        if self.schema: 
    8989            field = self.schema[fieldname] 
    90             if not field.format: 
    91                 raise Exception("%s field has no format" % field) 
    92             return [token.text for token in field.format.analyze(text, mode="query", **kwargs)] 
     90            return list(field.process_text(text, mode="query", **kwargs)) 
    9391        else: 
    9492            return [text] 
    9593     
    9694    def make_basic_clause(self, fieldname, text, boost=1.0): 
     95        if self.schema: 
     96            field = self.schema[fieldname] 
     97            if field.parse_query: 
     98                return field.parse_query(fieldname, text, boost=boost) 
     99         
    97100        parts = self.get_term_text(fieldname, text) 
    98101        if len(parts) > 1: 
     
    100103        else: 
    101104            return self.termclass(fieldname, parts[0], boost=boost) 
    102          
     105     
    103106    def make_clause(self, text, boost=1.0): 
    104107        return self.make_basic_clause(self.fieldname, text, boost=boost)