Esempio n. 1
0
File: fields.py Progetto: oier/Yaki
    def parse_query(self, fieldname, qstring, boost=1.0):
        from whoosh import query
        from whoosh.qparser import QueryParserError

        if qstring == "*":
            return query.Every(fieldname, boost=boost)

        try:
            text = self.to_text(qstring)
        except Exception, e:
            raise QueryParserError(e)
Esempio n. 2
0
File: fields.py Progetto: oier/Yaki
    def parse_range(self,
                    fieldname,
                    start,
                    end,
                    startexcl,
                    endexcl,
                    boost=1.0):
        from whoosh import query
        from whoosh.qparser import QueryParserError

        try:
            if start is not None:
                start = self.from_text(self.to_text(start))
            if end is not None:
                end = self.from_text(self.to_text(end))
        except Exception, e:
            raise QueryParserError(e)