(self, fieldname, text, termclass, boost=1.0, tokenize=True,
                   removestops=True)
return termclass(fieldname, text, boost=boost)
Returns the appropriate query object for a single term in the query
        string.
Returns the appropriate query object for a single term in the query
        string.
Returns the appropriate query object for a single term in the query string .
def term_query(self, fieldname, text, termclass, boost=1.0, tokenize=True,
                   removestops=True):
        """Returns the appropriate query object for a single term in the query
        string.
        """

        if self.schema and fieldname in self.schema:
            field = self.schema[fieldname]

            # If this field type wants to parse queries itself, let it do so
            # and return early
            if field.self_parsing():
                try:
                    q = field.parse_query(fieldname, text, boost=boost)
                    return q
                except:
                    e = sys.exc_info()[1]
                    return query.error_query(e)

            # Otherwise, ask the field to process the text into a list of
            # tokenized strings
            texts = list(field.process_text(text, mode="query",
                                            tokenize=tokenize,
                                            removestops=removestops))

            # If the analyzer returned more than one token, use the field's
            # multitoken_query attribute to decide what query class, if any, to
            # use to put the tokens together
            if len(texts) > 1:
                return self.multitoken_query(field.multitoken_query, texts,
                                             fieldname, termclass, boost)

            # It's possible field.process_text() will return an empty list (for
            # example, on a stop word)
            if not texts:
                return None
            text = texts[0]

        return termclass(fieldname, text, boost=boost)
def term_query ( self , fieldname , text , termclass , boost = 1.0 , tokenize = True , removestops = True ) : if self . schema and fieldname in self . schema : field = self . schema [ fieldname ] # If this field type wants to parse queries itself, let it do so # and return early if field . self_parsing ( ) : try : q = field . parse_query ( fieldname , text , boost = boost ) return q except : e = sys . exc_info ( ) [ 1 ] return query . error_query ( e ) # Otherwise, ask the field to process the text into a list of # tokenized strings texts = list ( field . process_text ( text , mode = "query" , tokenize = tokenize , removestops = removestops ) ) # If the analyzer returned more than one token, use the field's # multitoken_query attribute to decide what query class, if any, to # use to put the tokens together if len ( texts ) > 1 : return self . multitoken_query ( field . multitoken_query , texts , fieldname , termclass , boost ) # It's possible field.process_text() will return an empty list (for # example, on a stop word) if not texts : return None text = texts [ 0 ] return termclass ( fieldname , text , boost = boost )