class_docstr: A hand-written query parser built on modular plug-ins. The default
  configuration implements a powerful fielded query language similar to
  Lucene's.
  
  You can use the ``plugins`` argument when creating the object to override
  the default list of plug-ins, and/or use ``add_plugin()`` and/or
  ``remove_plugin_class()`` to change the plug-ins included in the parser.
  
  >>> from whoosh import qparser
  >>> parser = qparser.QueryParser("content", schema)
  >>> parser.remove_plugin_class(qparser.WildcardPlugin)
  >>> parser.add_plugin(qparser.PrefixPlugin())
  >>> parser.parse(u"hello there")
  And([Term("content", u"hello"), Term("content", u"there")])
class_docstr_tok: ["A","hand-written","query","parser","built","on","modular","plug-ins",".","The","default","configuration","implements","a","powerful","fielded","query","language","similar","to","Lucene","'s",".","You","can","use","the","``","plugins","``","argument","when","creating","the","object","to","override","the","default","list","of","plug-ins",",","and\/or","use","``","add_plugin","(",")","``","and\/or","``","remove_plugin_class","(",")","``","to","change","the","plug-ins","included","in","the","parser",".",">",">",">","from","whoosh","import","qparser",">",">",">","parser","=","qparser.QueryParser","(","``","content","''",",","schema",")",">",">",">","parser.remove_plugin_class","(","qparser.WildcardPlugin",")",">",">",">","parser.add_plugin","(","qparser.PrefixPlugin","(",")",")",">",">",">","parser.parse","(","u","''","hello","there","''",")","And","(","[","Term","(","``","content","''",",","u","''","hello","''",")",",","Term","(","``","content","''",",","u","''","there","''",")","]",")"]
docstr: Returns the appropriate query object for a single term in the query
  string.
docstr_tok: ["Returns","the","appropriate","query","object","for","a","single","term","in","the","query","string","."]
code: 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)
  
imports: import sys
  from whoosh import query
  from whoosh.compat import text_type
  from whoosh.qparser import syntax
  from whoosh.qparser.common import print_debug, QueryParserError
label_desc: Use image node_id 11 for calling the QueryParser obj's underlying member method code with example usage: obj.term_query(fieldname, text, termclass, boost, tokenize, removestops) and returns: termclass, self, None, q, query