def _prepare_query_term(self, field, term):
        """Prepare a query term for inclusion in a query.

        This escapes the term and if necessary, wraps the term in quotes.

        """
        if term == "*":
            return term
        add_star = False
        if term[len(term) - 1] == '*':
            add_star = True
            term = term[0 : len(term) - 1]
        term = self._escape_query_term(term)
        if add_star:
            term = '{}*'.format(term)
        if self._get_solr_type(field) in ['string', 'text', 'text_ws']:
            return '"{}"'.format(term)
        return term
def _prepare_query_term ( self , field , term ) : if term == "*" : return term add_star = False if term [ len ( term ) - 1 ] == '*' : add_star = True term = term [ 0 : len ( term ) - 1 ] term = self . _escape_query_term ( term ) if add_star : term = '{}*' . format ( term ) if self . _get_solr_type ( field ) in [ 'string' , 'text' , 'text_ws' ] : return '"{}"' . format ( term ) return term
Prepare a query term for inclusion in a query.

        This escapes the term and if necessary, wraps the term in quotes.